helpers.cli: Fix regex validation (MR 2557)

According to Python documentation, p.match checks
if characters at the beginning of string match the regex

This commit changes validation to full length of string
This commit is contained in:
Anri Dellal 2025-02-20 18:29:40 +03:00 committed by Oliver Smith
parent f85899ef3d
commit 6411aa4791
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
2 changed files with 2 additions and 3 deletions

View file

@ -95,8 +95,7 @@ def ask(
if not validation_regex:
return ret
pattern = re.compile(validation_regex)
if pattern.match(ret):
if re.fullmatch(validation_regex, ret):
return ret
logging.fatal(