AnonyMonk: Note that you will never capture the C character in the string (if this is what you want to do) because the $str =~ /^(L+)/ expression will always match first in
if ($str =~ /^(L+)/ or $str =~ /^(L+C)/) { ... }
for the strings you give as examples. If you want the C captured, reverse the order of the matches
if ($str =~ /^(L+C)/ or $str =~ /^(L+)/) { ... }
or much better yet IMHO, just use a single regex with an optional C match
if ($str =~ /^(L+C?)/) { ... }
(See the ? quantifier in perlre.)
Give a man a fish: <%-{-{-{-<
In reply to Re^2: Regular expressions mystery
by AnomalousMonk
in thread Regular expressions mystery
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |