hotfix/simplify-regex (#5324)

This commit is contained in:
DidierRLopes
2023-08-15 00:39:10 -05:00
committed by GitHub
parent 2b2ccacbbe
commit c6b0bfe6f2

View File

@@ -1004,8 +1004,7 @@ class BaseController(metaclass=ABCMeta):
# Check if title has a valid format
title = " ".join(ns_parser.name) if ns_parser.name else ""
# To this day, the reason why /^[a-zA-Z0-9\s]+$/ does not work is unknown
pattern = re.compile(r"^[a-zA-Z0-9\s]+(?:[a-zA-Z0-9\s]+)*$")
pattern = re.compile(r"^[a-zA-Z0-9\s]+$")
if not pattern.match(title):
console.print(
f"[red]Title '{title}' has invalid format. Please use only digits, characters and whitespaces.[/]"