http://www.perlmonks.org?node_id=824931


in reply to Re: Grab everything not matched by regexp
in thread Grab everything not matched by regexp

Xiong's experience sounds familiar. I recommend you consider his suggestions.

I would also recommend studying the perldoc for regular expressions.

Named captures are also very helpful. If you can install Perl 5.10.1, I would recommend using them. Perl 5.10.0 has a memory leak associated with using them, but you might get away with it. Anyway, 5.10.0 is the first release that allows using named-captures.

UPDATE:

You probably also will want to look at Parse::RecDescent as mentioned by Anonymous Monk above.