5 ms·
Ripgrep includes one of the most prominent algorithms from Hyperscan internally for some expressions. Longer story: Ripgrep uses Rust's regex library, which us
by killercup 5y ago
Ripgrep includes one of the most prominent algorithms from Hyperscan internally for some expressions.
Longer story: Ripgrep uses Rust's regex library, which uses the Aho-Corasick library. That does not just provide the algorithm it is named after, but also "packed" ones using SIMD, including a Rust rewrite of the [Teddy algorithm][1] from the Hyperscan project.
[1]: https://github.com/BurntSushi/aho-corasick/tree/4499d7fdb41c6279ea1367bccf3daca9cb06c36c/src/packed/teddy https://github.com/BurntSushi/aho-corasick/tree/4499d7fdb41c...
- boredprograming 5y agoThat's awesome!
- kevincox 5y agoThis post by the author is a great introduction to the techniques used in ripgrep https://blog.burntsushi.net/ripgrep/ https://blog.burntsushi.net/ripgrep/