Nested Regex Conditionals

2005-08-23 Thread Paul Dale
Hi All, I know that several of you will probably want to reply you should write a parser, and I may. For that matter any tips on theory in that direction would be appreciated. However, if you would indulge me in my regex question I would also be most grateful. I'm writing an edi parser and

Re: Nested Regex Conditionals

2005-08-23 Thread Paul McGuire
This works (note relocated right paren at (?(second) ): #!/usr/bin/env python import re original_pattern = re.compile(r (?Pfirst(first)) (?(first) (?Psecond(second)) ) (?(second) (?Pthird(third)) ) , re.VERBOSE) pattern = re.compile(r