Skip to content

Commit eb7bc2f

Browse files
committed
expr: Allow only ASCII digits for regex range quantifiers
1 parent 4946922 commit eb7bc2f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/uu/expr/src/syntax_tree.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ where
302302
}
303303

304304
// Check if parsed quantifier is valid
305-
let re = Regex::new(r"^(\d*,\d*|\d+)$").expect("valid regular expression");
305+
let re = Regex::new(r"^([0-9]*,[0-9]*|[0-9]+)$").expect("valid regular expression");
306306
if let Some(captures) = re.captures(&quantifier) {
307307
let matched = captures.at(0).unwrap_or_default();
308308
match matched.split_once(',') {

0 commit comments

Comments
 (0)