summaryrefslogtreecommitdiff
path: root/src/validators/numeric.ml
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2025-05-13 15:27:22 -0500
committerGitHub <noreply@github.com>2025-05-13 15:27:22 -0500
commit176163e5a6911e88ca790e503ed501d5aceaff34 (patch)
tree314fd8c7b29de28ef063e1686c0b877047359686 /src/validators/numeric.ml
parent08e0d27887d073dc4b8e452af0a137cd8d30a7ac (diff)
parentc6cb5ce2724a52b3b7b3741323c4466c87953c6a (diff)
downloadvyos-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.ml6
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 =