From 5ddeb8f35e01fdb90ace17299975111a850082bc Mon Sep 17 00:00:00 2001 From: DidierRLopes Date: Mon, 14 Aug 2023 05:20:25 -0500 Subject: [PATCH] Fix regex (#5320) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * check that routine title is valid * more updates * small fixes * override local routine * more improvements to routine logic * --debug runs .dev * few more updates * small fix * rename BASE_URL from ultima to ULTIMA_BASE_URL * use debug from dataclasses instead of env since env doesn't get updated * create --dev flag that can point to .dev backend * merge conflits * few changes, made it actually work 🤣 * fix regex --------- Co-authored-by: tehcoderer --- openbb_terminal/parent_classes.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openbb_terminal/parent_classes.py b/openbb_terminal/parent_classes.py index 69c1710e32b..d0bb293902b 100644 --- a/openbb_terminal/parent_classes.py +++ b/openbb_terminal/parent_classes.py @@ -981,7 +981,8 @@ class BaseController(metaclass=ABCMeta): # Check if title has a valid format title = " ".join(ns_parser.name) if ns_parser.name else "" - pattern = re.compile(r"^[a-zA-Z0-9\s]+(?:[-a-zA-Z0-9\s]+)*$") + # 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]+)*$") if not pattern.match(title): console.print(f"[red]The title '{title}' has invalid format. Please use only digits, characters and whitespaces.[/red]") return