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


in reply to Re^2: parsing XML fragments (xml log files) with... a regex
in thread parsing XML fragments (xml log files) with XML::Parser

my $data= '(?: [^<>&]+ | &\#?\w+; )+';
should be
my $data= '(?: [^<&]+ | &\#?\w+; )+';

XML allows for unescaped ">"

Replies are listed 'Best First'.
Re^4: parsing XML fragments (xml log files) with... a regex
by tye (Sage) on Mar 23, 2011 at 18:09 UTC

    Yeah, XML got that wrong. I've never seen real XML that takes advantage of that and I always write my parsers to reject it, so I'll know if it ever happens. So far, my tiny universe of implementers of XML generators are smarter than the standard's authors on this point. :)

    - tye