in reply to Re^3: perl 5.14 regex: case insensitive match on international characters
in thread perl 5.14 regex: case insensitive match on international characters
The result is correct though: ŠIN matches šin ? matcheded. Do you know why perl is assuming that wide character are in print? This in fact causes me troubles with regular expressions somwhere elese in the code: I believe that š and Š are "seen as" (sorry for the horrible terminology) �, and that is why they match in the code above. Thanks for the help!use utf8; use feature 'unicode_strings'; my $string1 = "ŠIN"; my $string2 = "šin"; print "$string1 matches $string2 ? "; print $string1 =~ /$string2/i ? 'matched' : 'no match';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: perl 5.14 regex: case insensitive match on international characters
by tobyink (Canon) on Mar 16, 2012 at 17:55 UTC | |
by shamat (Acolyte) on Mar 19, 2012 at 15:44 UTC |