in reply to Regular expression for grabbing strings with multiple lines between tags

You can also read about the Common Regex Gotchas. The first one not only is a piece of advice you should follow, it also uses a problem similar to yours as an example, so you should be able to get your solution from it. The second probably applies to you as well, if you're not going to use a module to validate the whole XML file (meaning you trust the content to be what you expect), you just need to grab the text between </tag1> and <tag2>.

Edit: I may be wrong about the second gotcha though, you probably want to capture the content of the tags as well as what's in between.

  • Comment on Re: Regular expression for grabbing strings with multiple lines between tags

Replies are listed 'Best First'.
Re^2: Regular expression for grabbing strings with multiple lines between tags
by Max_NL (Novice) on Apr 05, 2016 at 11:17 UTC
    Handy tips in the link, thank you!