in reply to Re^2: RegEx Confusion
in thread RegEx Confusion
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"); }
|
|---|