http://qs1969.pair.com?node_id=55716

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

I have been already trying many approaches that would catch for me the following things:
-41
-55
-jj
1au
24u
36u
I have written the following regexp:
if ($MType =~ /-[45][15j]/ig || /[123][a46]u/ig || /7[9l][hb]/ig) { print "\"red\""; } else { print "\"#CCFFCC\""; }
All I'm getting is jj4. I have no idea where this comes from.

This is how I interpret my regexp:

1 regexp:  If the first char is '-' and second is 4 or 5 and third is 1 or 5 or j OR
2 regexp: If the first char is 1 or 2 or 3 and second is h or b and third is u <...> and so on.
Where is my logic flawed? I need some enlightment, PLEASE!