diff options
author | John Estabrook <jestabro@vyos.io> | 2025-05-13 15:27:22 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-13 15:27:22 -0500 |
commit | 176163e5a6911e88ca790e503ed501d5aceaff34 (patch) | |
tree | 314fd8c7b29de28ef063e1686c0b877047359686 /src/validators/numeric.ml | |
parent | 08e0d27887d073dc4b8e452af0a137cd8d30a7ac (diff) | |
parent | c6cb5ce2724a52b3b7b3741323c4466c87953c6a (diff) | |
download | vyos-utils-176163e5a6911e88ca790e503ed501d5aceaff34.tar.gz vyos-utils-176163e5a6911e88ca790e503ed501d5aceaff34.zip |
Merge pull request #33 from dmbaturin/T7450-use-pcre2
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 = |