mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-07-26 01:31:57 -07:00
grep-regex: add fast path for -w/--word-regexp
Previously, ripgrep would always defer to the regex engine's capturing matches in order to implement word matching. Namely, ripgrep would determine the correct match offsets via a capturing group, since the word regex is itself generated from the user supplied regex. Unfortunately, the regex engine's capturing mode is still fairly slow, so this commit adds a fast path to avoid capturing mode in the vast majority of cases. See comments in the code for details.
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@@ -202,6 +202,7 @@ name = "grep-regex"
|
||||
version = "0.1.5"
|
||||
dependencies = [
|
||||
"aho-corasick 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bstr 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"grep-matcher 0.1.3",
|
||||
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
Reference in New Issue
Block a user