in reply to Re^2: Comparing strings case insensitive
in thread Comparing strings case insensitive
Yes, because lc "alligatorz" eq lc "a.*z" will properly compare as unequal, whereas "alligatorz" =~ /^a.*z$/i incorrectly (for what you're trying to do) will match. That's what I mentioned about robustness, but again with the proper application of \Q that wouldn't be an issue.
That being said, I'd still use the lc $x eq lc $y version vice the \Q-ified regexp match as it's more explicit that you're doing a case insensitive comparison between fixed strings.
The cake is a lie.
The cake is a lie.
The cake is a lie.
|
|---|