http://qs321.pair.com?node_id=202749

moxliukas has asked for the wisdom of the Perl Monks concerning the following question:

Hello,

I know this question has been raised before, and I did try to Super Search for it, but none of the answers really right on the spot for me.

The problem is as follows:
I am writting a script that parses XML (and no, using XML::Parser or XML::simple is not the options as you need to compile them in order to use them -- otherwise it would be no problem). This XML has some tags that can go inside each other namely in this manner:

<value>...<value>...</value>...</value>
I need to get the stuff between the balanced <value> pairs. Obviously, the (.*?) approach does not work as it selects <code><value>...<value>...</value>. I am suspecting that one might need to use extended regular expression for this (backtracking?), but could you lead me on the rigth track how? (Or is it a much more difficult problem that cannot be solved by only using regexps?)

Thank you in advance