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!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.