From 7ab0d96b8a94d0464b875850e329e773101d9e40 Mon Sep 17 00:00:00 2001 From: Gnome Ann <> Date: Sun, 21 Nov 2021 01:06:31 -0500 Subject: [PATCH] Change the comment regex again to use fixed-length lookbehind --- aiserver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aiserver.py b/aiserver.py index 6db56fe4..4b14e345 100644 --- a/aiserver.py +++ b/aiserver.py @@ -123,7 +123,7 @@ class vars: regex_sl = re.compile(r'\n*(?<=.) *\n(.|\n)*') # Pattern for limiting the output to a single line acregex_ai = re.compile(r'\n* *>(.|\n)*') # Pattern for matching adventure actions from the AI so we can remove them acregex_ui = re.compile(r'^ *(>.*)$', re.MULTILINE) # Pattern for matching actions in the HTML-escaped story so we can apply colouring, etc (make sure to encase part to format in parentheses) - comregex_ai = re.compile(r'(?:\n<\|(?:.|\n)*?\|>(?=\n|$))|(?:(?<=\n|^)<\|(?:.|\n)*?\|>\n)|(?:<\|(?:.|\n)*?\|>)') # Pattern for matching comments to remove them before sending them to the AI + comregex_ai = re.compile(r'(?:\n<\|(?:.|\n)*?\|>(?=\n|$))|(?:<\|(?:.|\n)*?\|>\n)|(?:<\|(?:.|\n)*?\|>)') # Pattern for matching comments to remove them before sending them to the AI comregex_ui = re.compile(r'(<\|(?:.|\n)*?\|>)') # Pattern for matching comments in the editor actionmode = 1 adventure = False