We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d4ea506 commit f480c81Copy full SHA for f480c81
tool/generate_text.py
@@ -12,11 +12,14 @@
12
if len(magicks) > 1:
13
print("ERROR: Multiple files match %s" % globspec)
14
for m in magicks:
15
- print m
+ print(m)
16
sys.exit(1)
17
CONVERT_CMD = magicks[0]
18
19
-TEXT_RE = re.compile("(?P<quote>['\"])TEX:([^(?P=quote)]+)(?P=quote)");
+# find strings that look like "TEX:abc" or 'TEX:abc' (note different quote types
20
+# use <quote> to store the type of quote
21
+# use the negative-lookahead regex ((?!(?P=quote)).) to match non-quote characters
22
+TEXT_RE = re.compile("(?P<quote>['\"])TEX:(((?!(?P=quote)).)+)(?P=quote)")
23
24
if len(sys.argv) <= 2:
25
print("Usage: generate_text <outputdir> <basedir1> <basedir2> ...")
0 commit comments