mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-29 04:32:43 +00:00
hotfix/simplify-regex (#5324)
This commit is contained in:
@@ -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.[/]"
|
||||
|
||||
Reference in New Issue
Block a user