intel hyperscan luaffi bind
apt-get install libhyperscan-dev
g++ -O3 -o hs_scan hs_scan.cpp $(pkg-config --cflags --libs libhs)
./hs_scan -h
txt db example
0:/st[A-Z]r/HV
1:/str2/HV
g++ -shared -fPIC -O3 -o libhscan.so hs_scan.cpp $(pkg-config --cflags --libs libhs) -fopenmp
cp libhscan.so to openresty path -- "/opt/openresty/nginx/lib/libhscan.so"
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
local modhs = require "hs_scan"
local m = modhs.match("updatexml user_tables", "/opt/sql_hs.bin")
ngx.log(ngx.DEBUG, "count ", m.count)
ngx.log(ngx.DEBUG, "id 1 ", m.groups[0].id)
ngx.log(ngx.DEBUG, "id 2 ", m.groups[1].id)