in reply to Re^3: regular expression and nested tags
in thread regular expression and nested tags

That doesn't work. I must be doing something wrong:

#!perl $a = 'A<div>B<div>C<div>D</div>E</div>F</div>G'; $a =~ m%<div>((?:(?!</div>).)*)</div>%; print "=$1=\n";

I want to get just =D=. Also tried variations of this advanced patterns like look-behind without success.

Replies are listed 'Best First'.
Re^5: regular expression and nested tags
by ikegami (Patriarch) on Jun 13, 2009 at 05:42 UTC
    So exclude <div> too!