summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crates/globset/src/glob.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/crates/globset/src/glob.rs b/crates/globset/src/glob.rs
index cda39cab..d19c70ed 100644
--- a/crates/globset/src/glob.rs
+++ b/crates/globset/src/glob.rs
@@ -736,7 +736,7 @@ impl Tokens {
// It is possible to have an empty set in which case the
// resulting alternation '()' would be an error.
if !parts.is_empty() {
- re.push('(');
+ re.push_str("(?:");
re.push_str(&parts.join("|"));
re.push(')');
}
@@ -1276,6 +1276,7 @@ mod tests {
toregex!(re32, "/a**", r"^/a.*.*$");
toregex!(re33, "/**a", r"^/.*.*a$");
toregex!(re34, "/a**b", r"^/a.*.*b$");
+ toregex!(re35, "{a,b}", r"^(?:b|a)$");
matches!(match1, "a", "a");
matches!(match2, "a*b", "a_b");