Intel Hyperscan is a high-performance multiple regex matching library
intel.github.io
intel.github.io
(One if the use cases of this library is scanning through bulk intercept data streams for a set of key words.)
https://groups.google.com/g/comp.arch/c/UXEi7G6WHuU/m/Z2z7fC...
Edit: This is a surprisingly heavy build. Over 15 minutes on my somewhat older i5. I suggest using make -j instead of cmake -build to speed it up. Decent number of compiler warnings too.
Sadly the hyperscan build crapped out for me in the linking phase, failing to find a bunch of coreX and avx optimized memset functions.
We are quite happy with the huge performance boost, never looking back :) Yara was even segfaulted when we tried to extract an Ubuntu ISO image with it, never had problems like that with Hyperscan.
The only problem with Hyperscan is that it only supports Intel CPUs (it has some hand-crafted assembly), so it doesn't work on Apple M1 Macs, but there is a fork called VectorScan, which is working on ARM: https://github.com/VectorCamp/vectorscan
We implemented a couple of small DSL classes in Python to be able to define YARA-like rules, it might be useful for you too, check it out here: https://github.com/onekey-sec/unblob/blob/cdd7a46667ffdfdfae...
VectorScan is its successor.
https://devblogs.microsoft.com/dotnet/regular-expression-imp...
Hyperscan: High-performance multiple regex matching library from Intel - https://news.ycombinator.com/item?id=21873557 - Dec 2019 (53 comments)
Hyperscan: A Fast Multi-Pattern Regex Matcher for Modern CPUs - https://news.ycombinator.com/item?id=19270199 - Feb 2019 (36 comments)
Multiple regex performance shootout: RE2 vs. Intel's Hyperscan - https://news.ycombinator.com/item?id=14608663 - June 2017 (55 comments)
Hyperscan, a high-performance multiple regex matching library - https://news.ycombinator.com/item?id=10420295 - Oct 2015 (19 comments)
After all, Hyperscan's original objective was to be able to find where, in a large input, any of many patterns may match. It doesn't really make sense to use it as a general purpose regex library, because it wasn't built for that.
And even if that were the case you could grab your sentences from the 1TB file in front of you with hyperscan, and then do a capture on the results.