diff options
author | Daniil Baturin <daniil@baturin.org> | 2025-05-13 13:04:44 +0100 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2025-05-13 13:07:33 +0100 |
commit | c6cb5ce2724a52b3b7b3741323c4466c87953c6a (patch) | |
tree | 314fd8c7b29de28ef063e1686c0b877047359686 /src/validators/numeric.ml | |
parent | 08e0d27887d073dc4b8e452af0a137cd8d30a7ac (diff) | |
download | vyos-utils-c6cb5ce2724a52b3b7b3741323c4466c87953c6a.tar.gz vyos-utils-c6cb5ce2724a52b3b7b3741323c4466c87953c6a.zip |
validators: T7450: use PCRE2 instead of the outdated original PCRE
Diffstat (limited to 'src/validators/numeric.ml')
-rw-r--r-- | src/validators/numeric.ml | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/validators/numeric.ml b/src/validators/numeric.ml index 0c75f83..e6caddc 100644 --- a/src/validators/numeric.ml +++ b/src/validators/numeric.ml @@ -65,11 +65,11 @@ let check_positive opts m = failwith "option '--positive does' not apply to a range value" let looks_like_number value = - try let _ = Pcre.exec ~pat:"^(\\-?)[0-9]+(\\.[0-9]+)?$" value in true + try let _ = Pcre2.exec ~pat:"^(\\-?)[0-9]+(\\.[0-9]+)?$" value in true with Not_found -> false let is_relative value = - try let _ = Pcre.exec ~pat:"^[+-][0-9]+$" value in true + try let _ = Pcre2.exec ~pat:"^[+-][0-9]+$" value in true with Not_found -> false let number_string_drop_modifier value = @@ -170,7 +170,7 @@ let check_argument_type opts m = else Printf.ksprintf failwith "Value must be a number, not a range" let is_range_val s = - try let _ = Pcre.exec ~pat:"^[0-9]+-[0-9]+$" s in true + try let _ = Pcre2.exec ~pat:"^[0-9]+-[0-9]+$" s in true with Not_found -> false let var_numeric_str s = |