mirror of
https://github.com/TECHNOFAB11/bumpver.git
synced 2025-12-12 14:30:09 +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)
|
||||
|
||||
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\n(" , tmp_regex)
|
||||
tmp_regex, _ = re.subn(r"^\)\)" , ")\n)" , tmp_regex, flags=re.MULTILINE)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue