in reply to Re: Regex match: Ignoring first occurences
in thread Regex match: Ignoring first occurences

Thank you very much. I translated from my original code to a 'dumbed down' version to get the issue across more easily. I guess I didnt do a good enough job.

For one, I should have added that the xml string has no line breaks in it and without those your regex doesnt seem to work anymore. (tried only on notepad++'s regex plugin, though)

I was also actually using the '\.'. Im sorry for not putting it in here.

It's kind of complicated to explain why I can only use a regex. It has to do with a piece of software I have to use that only takes regex as an input param to retrieve information out of a file. I have heard about regex being a terrible idea for parsing xml and I try to avoid it as often as possible. However, Im not entirely sure about the reasons. You happen to have a good resource to read up on this?

Thank you very much!
  • Comment on Re^2: Regex match: Ignoring first occurences

Replies are listed 'Best First'.
Re^3: Regex match: Ignoring first occurences
by GotToBTru (Prior) on Aug 10, 2015 at 15:26 UTC

    The repetitious and hierarchical nature of XML often makes use of regexes difficult. There are several useful XML modules which make dealing with it easier. Well, at least less error prone! Especially if the precise structure of the XML may change over time. Popular modules include XML::Twig, XML::LibXML, XML::Rules. Avoid XML::Simple. A few of these have good tutorial pages available. You can find examples of use with Super Search here.

    Dum Spiro Spero