Good luck. About the "i", keep in mind that the following won't match:
$pattern = qr/A/; if ('a' =~ m/$pattern/i) { print("Match (case-insensitive)\n"); } else { print("No match (case-sensitive)\n"); }
Whatever is or isn't on the qr// overrides what is or isn't on the m//. The "i" is misleading. If you want, you could drop the m// altogether:
$pattern = qr/A/; if ('a' =~ $pattern) { print("Match (case-insensitive)\n"); } else { print("No match (case-sensitive)\n"); }
In reply to Re^3: RegEx Confusion
by ikegami
in thread RegEx Confusion
by Argel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |