mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
reduce regex
This commit is contained in:
parent
0f4adb1074
commit
ba1c396792
4
tasks.py
4
tasks.py
@ -502,9 +502,7 @@ def test_translations(c):
|
|||||||
# complie regex
|
# complie regex
|
||||||
reg = re.compile(
|
reg = re.compile(
|
||||||
r"[a-zA-Z0-9]{1}"+ # match any single letter and number
|
r"[a-zA-Z0-9]{1}"+ # match any single letter and number
|
||||||
r"(?![^{]*})"+ # that is not inside curly brackets
|
r"(?![^{\(\<]*[}\)\>])"+ # that is not inside curly brackets, brackets or a tag
|
||||||
r"(?![^\<]*\>)"+ # that is not a tag
|
|
||||||
r"(?![^\(]*\))"+ # that is not inside brackets
|
|
||||||
r"(?<![^\%][^\(][)][a-z])"+ # that is not a specially formatted variable with singles
|
r"(?<![^\%][^\(][)][a-z])"+ # that is not a specially formatted variable with singles
|
||||||
r"(?![^\\][\n])" # that is not a newline
|
r"(?![^\\][\n])" # that is not a newline
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user