From c6cb5ce2724a52b3b7b3741323c4466c87953c6a Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Tue, 13 May 2025 13:04:44 +0100 Subject: validators: T7450: use PCRE2 instead of the outdated original PCRE --- src/validators/numeric.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/validators/numeric.ml') 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 = -- cgit v1.2.3