re.search slashes

2006-02-04 Thread 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.compil

Re: re.search slashes

2006-02-04 Thread pyluke
Scott David Daniels wrote: > pyluke wrote: >> 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 sho

Re: re.search slashes

2006-02-04 Thread pyluke
> To add to what scott said, two advices: > 1. Use Kodos, it's a RE debugger and an extremely fine tool to generate > your regular expressions. Ok, just found this. Will be helpful. > 2. Read the module's documentation. Several time. In your case read the > "negative lookbehind assertion" par

Re: re.search slashes

2006-02-04 Thread pyluke
> 2. Read the module's documentation. Several time. In your case read the > "negative lookbehind assertion" part "(? you understand how it may be of use to you. OK. lookbehind would be more useful/suitable here... -- http://mail.python.org/mailman/listinfo/python-list