mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-05-19 09:40:22 -07:00
ignore: tweak regex crate features
This removes most of the Unicode features as they aren't currently used. We can always add them back later if necessary. We can avoid the unicode-perl feature by changing `\s` to `[[:space:]]`, which uses the ASCII-only definition of `\s`. Since we don't expect non-ASCII whitespace in git config files, this seems okay. Closes #2502
This commit is contained in:
parent
96cfc0ed13
commit
0c1cbd99f3
@ -23,7 +23,7 @@ globset = { version = "0.4.10", path = "../globset" }
|
|||||||
lazy_static = "1.1"
|
lazy_static = "1.1"
|
||||||
log = "0.4.5"
|
log = "0.4.5"
|
||||||
memchr = "2.5"
|
memchr = "2.5"
|
||||||
regex = "1.8.3"
|
regex = { version = "1.9.0", default-features = false, features = ["perf", "std", "unicode-gencat"] }
|
||||||
same-file = "1.0.4"
|
same-file = "1.0.4"
|
||||||
thread_local = "1"
|
thread_local = "1"
|
||||||
walkdir = "2.2.7"
|
walkdir = "2.2.7"
|
||||||
|
@ -596,8 +596,13 @@ fn parse_excludes_file(data: &[u8]) -> Option<PathBuf> {
|
|||||||
// probably works in more circumstances. I guess we would ideally have
|
// probably works in more circumstances. I guess we would ideally have
|
||||||
// a full INI parser. Yuck.
|
// a full INI parser. Yuck.
|
||||||
lazy_static::lazy_static! {
|
lazy_static::lazy_static! {
|
||||||
static ref RE: Regex =
|
static ref RE: Regex = Regex::new(
|
||||||
Regex::new(r"(?im)^\s*excludesfile\s*=\s*(.+)\s*$").unwrap();
|
r"(?xim-u)
|
||||||
|
^[[:space:]]*excludesfile[[:space:]]*
|
||||||
|
=
|
||||||
|
[[:space:]]*(.+)[[:space:]]*$
|
||||||
|
"
|
||||||
|
).unwrap();
|
||||||
};
|
};
|
||||||
let caps = match RE.captures(data) {
|
let caps = match RE.captures(data) {
|
||||||
None => return None,
|
None => return None,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user