From 925529837eab5be22ae9ab316d2638127fe165b4 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sun, 17 Jun 2018 01:26:18 +0200 Subject: [PATCH] Backport inlinefunc regex update from develop olc branch. Resolves #1498. --- evennia/utils/inlinefuncs.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/evennia/utils/inlinefuncs.py b/evennia/utils/inlinefuncs.py index e103e217d7..b09cc432e7 100644 --- a/evennia/utils/inlinefuncs.py +++ b/evennia/utils/inlinefuncs.py @@ -191,15 +191,18 @@ except AttributeError: _RE_STARTTOKEN = re.compile(r"(?.*?)(?.*?)(?(?(?(?\\'|\\"|\\\)|\\$\w+\()| # escaped tokens should re-appear in text - (?P[\w\s.-\/#!%\^&\*;:=\-_`~\|\(}{\[\]]+|\"{1}|\'{1}) # everything else should also be included""", - re.UNICODE + re.IGNORECASE + re.VERBOSE + re.DOTALL) + (?.*?)(?.*?)(?(?(?(? # escaped tokens to re-insert sans backslash + \\\'|\\\"|\\\)|\\\$\w+\()| + (?P # everything else to re-insert verbatim + \$(?!\w+\()|\'{1}|\"{1}|\\{1}|[^),$\'\"\\]+)""", + re.UNICODE | re.IGNORECASE | re.VERBOSE | re.DOTALL) # Cache for function lookups.