4 ms·
It's interesting to see block list creators more or less reinventing all the tricks that network-security regex implementation people invented 10-20 years ago.
by glangdale 7y ago
It's interesting to see block list creators more or less reinventing all the tricks that network-security regex implementation people invented 10-20 years ago. One wonders whether they might do better picking up an off-the-shelf regex implementation (e.g. our own Hyperscan, or for those who must must must have something in Rust, the engine from ripgrep, which I believe is just called "regex" :-) ).
- pythux 7y agoAs far as I know the « regex » crate is used in some places. But interpreting block rules has a lot to do with specific options and behaviors which are pretty tailored to the task and it would not be easy to use off the shelf regex implementations for this. Although I myself looked at Hyperscan in the past for the purpose of blocking ads (the performance looks amazing!).
- pgl 7y agoHey, some of those block list creators are also network-security people from 10-20 years ago. :)
- hokkos 7y agoHere the specificity is it tries to match against multiple regex, in rust there is RegexSet from the regex engine, it performs a single pass, but I'm not sure it optimize a lot graph for matching. It seems HyperScan can do a lot of optimization by extracting commonalities between regexes. https://docs.rs/regex/1.1.7/regex/struct.RegexSet.html https://docs.rs/regex/1.1.7/regex/struct.RegexSet.html http://intel.github.io/hyperscan/dev-reference/intro.html#compilation http://intel.github.io/hyperscan/dev-reference/intro.html#co...