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

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

Hello, I'm in need of some regular expression help.

I'd like to create a regular expression that would match the following strings:

<*2>H<3:0>,<*2>I<3:0>,...,<*2>Z<2:0>
H<3:0>,<*2>I<3:0>,...,<*2>Z<2:0>

So the <*K> is optional in each string and there could be numerous tokens (seperated by commas).

I have the following:
$str =~ /<\*\d+>([^<]+)<(\d+):(\d+)>,<\*\d+>([^<]+)<(\d+):(\d+)>/
but this will only match
<*K>A<N:M>,<*K>B<N:M>
and not
A<N:M>,<*K>B<N:M>.

Is such a regular expression possible?

Thanks!