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

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

Dear Perlmonks

Applying the following code

while ($_ =~ /({\d+})/ || $_ =~ /({\w+>)/ || $_ =~ /(<\w+})/){ print "$1\n"; }

to this text

This is <i} a test {i> sentence <i}

I get

{i>    <i}    <i}

Is there any way to get them according to their occurrence? So,

<i}  {i>  <i}

Thanks