in reply to Re: Did the inefficiency of /i get fixed?
in thread Did the inefficiency of /i get fixed?
I wonder sometimes whether anyone things to go read the source to see what the answer is. /i appears to change such nodes as `EXACT` to `EXACTF` which for non-unicode is a "find the first character of the match, then call util.c:Perl_ibcmp which is a dainty little function which relies on a built-in case folding table. There's no implicit lc() and copy to a buffer going on here.
If you have a utf8 regular expression then it does what Friedl's book suggests.
If you merely have utf8 data then see utf8.c:Perl_ibcmp_utf8 which is long enough to deter me from wanting to read it at the moment but still doesn't appear to make a separate lc()'d copy of the data.
This is all from looking at 5.8.3, btw.
|
|---|