Skip to content

Commit 79d070a

Browse files
committed
Consolidate script to detect substitutions in the text
1 parent 74dd291 commit 79d070a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/find_set_subst.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ def get_subst_from_file(file):
2020
"""
2121

2222
# defines a pattern for a substitution
23-
# anything inside || except is preceded by ..
24-
s_pattern = re.compile(r"(?<!\.\. )\|([\w\d-]+)\|")
23+
# i.e., anything inside || except is preceded by .. and/or not surrounded by a character
24+
s_pattern = re.compile(r"(?<!\.\. )(?<!\w)\|([\w\d-]+)\|(?![\w-])")
2525
s_title = re.compile(r"\.\. Substitutions definitions - AVOID EDITING "
2626
r"PAST THIS LINE\n")
2727
subs = []

0 commit comments

Comments
 (0)