Skip to content

Commit

Permalink
🐛 Use raw strings to fix invalid escape (#427)
Browse files Browse the repository at this point in the history
The replacement string contains `\g`, which is an invalid escape in Python (and not supposed to be a python escape).
  • Loading branch information
kno10 authored Dec 15, 2023
1 parent f4fd17e commit e4c6eb6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bibtexparser/latexenc.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def protect_uppercase(string):
:param string: string to convert
:returns: string
"""
string = re.sub('([^{]|^)([A-Z])([^}]|$)', '\g<1>{\g<2>}\g<3>', string)
string = re.sub(r'([^{]|^)([A-Z])([^}]|$)', r'\g<1>{\g<2>}\g<3>', string)
return string


Expand Down

0 comments on commit e4c6eb6

Please sign in to comment.