From bdef2dd0a9fd3cfece454b570459fce7bcd386ee Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Mon, 12 Jan 2026 15:06:04 +0100 Subject: [PATCH] Fixed bad regex in packages promise method for pip The packages promise method for pip fails with error: ``` error: Regular expression error: 'invalid range in character class' in expression '^([[:alnum:]-_]+\s\([\d.]+\))' (offset: 13) ``` This is probably a regression after upgrading from PCRE to PCRE2. The regex engine complains about the hyphen, which has a special meaning within the square brackets. The bug is easily fixed by escaping the hyphen. Ticket: ENT-13667 Changelog: Title Signed-off-by: Lars Erik Wik (cherry picked from commit 8871aeffd9dd58b755547aac20b1ce3aa530a8dc) --- lib/packages.cf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/packages.cf b/lib/packages.cf index 666bc8d278..a77375b9fb 100644 --- a/lib/packages.cf +++ b/lib/packages.cf @@ -414,9 +414,9 @@ bundle common pip_knowledge vars: "call_pip" string => "$(paths.path[pip])"; - "pip_list_name_regex" string => "^([[:alnum:]-_]+)\s\([\d.]+\)"; - "pip_list_version_regex" string => "^[[:alnum:]-_]+\s\(([\d.]+)\)"; - "pip_installed_regex" string => "^([[:alnum:]-_]+\s\([\d.]+\))"; + "pip_list_name_regex" string => "^([[:alnum:]\-_]+)\s\([\d.]+\)"; + "pip_list_version_regex" string => "^[[:alnum:]\-_]+\s\(([\d.]+)\)"; + "pip_installed_regex" string => "^([[:alnum:]\-_]+\s\([\d.]+\))"; } bundle common solaris_knowledge