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:
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?)<value>...<value>...</value>...</value>
Thank you in advance
|
---|
Replies are listed 'Best First'. | |
---|---|
•Re: Balanced delimiter parsing
by merlyn (Sage) on Oct 04, 2002 at 14:58 UTC | |
Re: Balanced delimiter parsing
by Zaxo (Archbishop) on Oct 04, 2002 at 15:05 UTC | |
Re: Balanced delimiter parsing
by broquaint (Abbot) on Oct 04, 2002 at 14:58 UTC | |
Re: Balanced delimiter parsing
by helgi (Hermit) on Oct 04, 2002 at 16:20 UTC | |
Re: Balanced delimiter parsing
by Abigail-II (Bishop) on Oct 07, 2002 at 11:23 UTC | |
Re: Balanced delimiter parsing
by I0 (Priest) on Oct 06, 2002 at 06:43 UTC |
Back to
Seekers of Perl Wisdom