forked from Mirror/pmbootstrap
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:
parent
f85899ef3d
commit
6411aa4791
2 changed files with 2 additions and 3 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue