Skip to content

Commit e4c6eb6

Browse files
authored
🐛 Use raw strings to fix invalid escape (#427)
The replacement string contains `\g`, which is an invalid escape in Python (and not supposed to be a python escape).
1 parent f4fd17e commit e4c6eb6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

bibtexparser/latexenc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def protect_uppercase(string):
9090
:param string: string to convert
9191
:returns: string
9292
"""
93-
string = re.sub('([^{]|^)([A-Z])([^}]|$)', '\g<1>{\g<2>}\g<3>', string)
93+
string = re.sub(r'([^{]|^)([A-Z])([^}]|$)', r'\g<1>{\g<2>}\g<3>', string)
9494
return string
9595

9696

0 commit comments

Comments
 (0)