"be consistent" | |
PerlMonks |
Re^2: Case insensitive string comparisonby AnomalousMonk (Archbishop) |
on Jun 28, 2020 at 05:21 UTC ( [id://11118617]=note: print w/replies, xml ) | Need Help?? |
I agree with matching against a particular field rather than against the entire string, and with using a character class rather than several I have some comments regarding implementation details. I'm forced to admit, however, that because I don't really know DAN0207's requirements, these comments may be meaningless. That said, I forge ahead. Firstly, the /SMS[1HI]/i match against the extracted $SMSfield field allows a field like 'xSMSIx' to be accepted. This match could benefit from anchor assertions: / \A SMS [1HI] \z /xi rejects this field.
Secondly, I find the use of the global /i flag problematic. In the OPed code statement Give a man a fish: <%-{-{-{-<
In Section
Seekers of Perl Wisdom
|
|