in reply to how to nullify case sensitivity
If you wanted to use Unicode's definition of case insensitivity — they are the experts in this area — you should convert the strings to fold case (not lower case or upper case) and then compare them. The simplest way of doing that is:
$s1 =~ /^\Q$s2\E\z/i
Like the lc and uc methods, this assumes the string has previously been normalised. All together,
use Unicode::Normalize qw( NFC ); $s1 = NFC($s1); $s2 = NFC($s2); $s1 =~ /^\Q$s2\E\z/i
|
|---|