P
pyluke
I'm parsing LaTeX document and want to find lines with equations blocked
by "\[" and "\]", but not other instances of "\[" like "a & b & c \\[5pt]"
so, in short, I was to match "\[" but not "\\]"
to add to this, I also don't want lines that start with comments.
I've tried:
check_eq = re.compile('(?!\%\s*)\\\\\[')
check_eq.search(line)
this works in finding the "\[" but also the "\\["
so I would think this would work
check_eq = re.compile('(?![\%\s*\\\\])\\\\\[')
check_eq.search(line)
but it doesn't. Any tips?
by "\[" and "\]", but not other instances of "\[" like "a & b & c \\[5pt]"
so, in short, I was to match "\[" but not "\\]"
to add to this, I also don't want lines that start with comments.
I've tried:
check_eq = re.compile('(?!\%\s*)\\\\\[')
check_eq.search(line)
this works in finding the "\[" but also the "\\["
so I would think this would work
check_eq = re.compile('(?![\%\s*\\\\])\\\\\[')
check_eq.search(line)
but it doesn't. Any tips?