Make python Regex Strings raw to avoid py3.12 SyntaxError

This commit is contained in:
bgbsww
2024-09-26 18:12:20 -04:00
committed by Yorik van Havre
parent e41def8c74
commit 64ecfe7a0e
26 changed files with 75 additions and 75 deletions

View File

@@ -141,10 +141,10 @@ def replace(template, dict, file):
"Test: copy a block of lines, with full processing"
import re
rex = re.compile("@([^@]+)@")
rex = re.compile(r"@([^@]+)@")
rbe = re.compile(r"\+")
ren = re.compile("-")
rco = re.compile("= ")
ren = re.compile(r"-")
rco = re.compile(r"= ")
x = 23 # just a variable to try substitution
cop = copier(rex, dict, rbe, ren, rco)
lines_block = [line + "\n" for line in template.split("\n")]
@@ -156,10 +156,10 @@ if __name__ == "__main__":
"Test: copy a block of lines, with full processing"
import re
rex = re.compile("@([^@]+)@")
rex = re.compile(r"@([^@]+)@")
rbe = re.compile(r"\+")
ren = re.compile("-")
rco = re.compile("= ")
ren = re.compile(r"-")
rco = re.compile(r"= ")
x = 23 # just a variable to try substitution
cop = copier(rex, globals(), rbe, ren, rco)
lines_block = [