in reply to P:RD and XML (minor code review)
I'm attempting to parse XML files with Parse::RecDescent
Gotta ask why!
Anyway, Perl can handle that with zero-width lookaheads.
orCharData : /(?:(?!\]\]>)[^<&])*/ { XML::CharData->new($item[1]) }
orCharData : /(?:(?!<|&|\]\]>).)*/ { XML::CharData->new($item[1]) }
CharData : /(?:[^<&\]]|\](?!\]>))*/ { XML::CharData->new($item[1]) }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: P:RD and XML (minor code review)
by glenhein (Initiate) on Feb 17, 2010 at 16:29 UTC |