mirror of
https://github.com/TECHNOFAB11/bumpver.git
synced 2025-12-13 06:50:08 +01:00
fix " escaping
This commit is contained in:
parent
e3067a06ea
commit
54ab1151f1
1 changed files with 1 additions and 0 deletions
|
|
@ -27,6 +27,7 @@ def format_regex(regex: str) -> str:
|
||||||
re.compile(regex)
|
re.compile(regex)
|
||||||
|
|
||||||
tmp_regex = regex.replace(" ", r"[ ]")
|
tmp_regex = regex.replace(" ", r"[ ]")
|
||||||
|
tmp_regex = tmp_regex.replace('"', r'\"')
|
||||||
tmp_regex, _ = re.subn(r"([^\\])?\)(\?)?", "\\1)\\2\n", tmp_regex)
|
tmp_regex, _ = re.subn(r"([^\\])?\)(\?)?", "\\1)\\2\n", tmp_regex)
|
||||||
tmp_regex, _ = re.subn(r"([^\\])\(" , "\\1\n(" , tmp_regex)
|
tmp_regex, _ = re.subn(r"([^\\])\(" , "\\1\n(" , tmp_regex)
|
||||||
tmp_regex, _ = re.subn(r"^\)\)" , ")\n)" , tmp_regex, flags=re.MULTILINE)
|
tmp_regex, _ = re.subn(r"^\)\)" , ")\n)" , tmp_regex, flags=re.MULTILINE)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue