mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 19:17:43 +00:00
expr: Allow only ASCII digits for regex range quantifiers
This commit is contained in:
parent
4946922c0f
commit
eb7bc2f251
1 changed files with 1 additions and 1 deletions
|
@ -302,7 +302,7 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if parsed quantifier is valid
|
// Check if parsed quantifier is valid
|
||||||
let re = Regex::new(r"^(\d*,\d*|\d+)$").expect("valid regular expression");
|
let re = Regex::new(r"^([0-9]*,[0-9]*|[0-9]+)$").expect("valid regular expression");
|
||||||
if let Some(captures) = re.captures(&quantifier) {
|
if let Some(captures) = re.captures(&quantifier) {
|
||||||
let matched = captures.at(0).unwrap_or_default();
|
let matched = captures.at(0).unwrap_or_default();
|
||||||
match matched.split_once(',') {
|
match matched.split_once(',') {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue