reduce regex

This commit is contained in:
Matthias 2021-11-25 00:49:27 +01:00
parent 0f4adb1074
commit ba1c396792
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -502,9 +502,7 @@ def test_translations(c):
# complie regex
reg = re.compile(
r"[a-zA-Z0-9]{1}"+ # match any single letter and number
r"(?![^{]*})"+ # that is not inside curly brackets
r"(?![^\<]*\>)"+ # that is not a tag
r"(?![^\(]*\))"+ # that is not inside brackets
r"(?![^{\(\<]*[}\)\>])"+ # that is not inside curly brackets, brackets or a tag
r"(?<![^\%][^\(][)][a-z])"+ # that is not a specially formatted variable with singles
r"(?![^\\][\n])" # that is not a newline
)