Hi Guys,
I have a regex designed to pick out some XML tags.
A typical string might look like this:
<COMMA><EXHIBITING></EXHIBITING></COMMA>
I want to process the smallest and inner-most pair of tags first (ie, in this case <EXHIBITING></EXHIBITING>).
I am using the regex:
my $r = '\<(\D+)\>(.*?)(\<\/\1\>)'; while ($loc_diagnoses_text =~ m/$r/gi){ ... processing stuff .... }
But it is processing the <COMMA><COMMA> pair first. How do I fix this?
Regards
Steve
In reply to Regex priorities. by Steve_BZ
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |