in reply to Balanced delimiter parsing
Using only regexps
$_="...<value>...<value>...</value>...</value>..."; ($re=$_)=~s#((<value>)|(</value>)|.)#${[')','']}[!$3]\Q$1\E${['(','']} +[!$2]#gs; print join "\n",eval{/$re/}; die $@ if $@=~/unmatched/i;
|
---|
In Section
Seekers of Perl Wisdom