Re: 'medium' reg exp greediness?




Alan Campbell wrote:
hello folks,
< home-made XML parsing scrip snipped >
Any ideas on how best to reg exp this? Or do I just need to improve/narrow my search string.

Don't use regular expressions to parse XML. Use an XML parser to parse
XML, such as XML::Simple.

To further complicate life, I cant guarentee the level of nesting.

And that's one good reason why.

Or, alternatively, ask robic to have a look at his XML parsing regular
expression and enjoy your stay in A World of Pain.

-jp

.



Relevant Pages

  • Re: Unit testing - Breaking bad habits
    ... One is a Bean that pulls XML messages off a JMS queue, parses them, ... The second piece is a client jar that presents a DTO. ... unit testing, but many of the components are dependent on dynamic data ... I wouldn't see much need to test the XML parsing ...
    (comp.lang.java.programmer)
  • RE: XML Parsing
    ... Subject: XML Parsing ... ElementTree) that are written explicitly for XML, ... potential surprises when trying to match XML tags - presence/absence/ ...
    (comp.lang.python)
  • Re: TclXML confusions (was: How can I ensure that I always have a list?)
    ... Whereas in PHP I read this and while not understanding XML parsing, ... The ability to convert my XML files into ... What do I do with the PHP array result? ...
    (comp.lang.tcl)
  • Re: [ANN] Ruby 1.8.7-p248 released.
    ... really smack you in the face if you are doing any XML parsing and ... The REXML library has a bug parsing the xml declaration standalone ... It is documented in Trac Ticket #152 for the REXML Trac Wiki. ...
    (comp.lang.ruby)
  • Re: [ANN] Ruby 1.8.7-p248 released.
    ... really smack you in the face if you are doing any XML parsing and ... The REXML library has a bug parsing the xml declaration standalone ...
    (comp.lang.ruby)