develooper Front page | perl.perl5.porters | Postings from April 2011

Re: Unicode regex negated case-insensitivity in 5.14.0-RC1

Thread Previous | Thread Next
From:
Tom Christiansen
Date:
April 28, 2011 14:00
Subject:
Re: Unicode regex negated case-insensitivity in 5.14.0-RC1
Message ID:
1388.1304024386@chthon
It's even weirder than that.  Given:

    $\ = "\n";
    my $x = "X-Xoqp-SDR-FpCqar4-Duooery-Faad-laeC_cCesspfpads:";
    print $x =~ /^[^\x00-\x1f\x7f-\xff :]+:/ || 0;
    print $x =~ /^[^\x00-\x1f\x7f-\xff :]+:/i || 0;
    utf8::upgrade($x);
    print $x =~ /^[^\x00-\x1f\x7f-\xff :]+:/ || 0;
    print $x =~ /^[^\x00-\x1f\x7f-\xff :]+:/i || 0;

Here are the results:

    % perl5.12.3 /tmp/bl
    1
    1
    1
    1

    % perl5.12.3 -M5.012 /tmp/bl
    1
    1
    1
    1

    % blead /tmp/bl
    1
    1
    1
    0

    % blead -M5.012 /tmp/bl
    1
    0
    1
    0

So with (full) Unicode strings, it's yet again different still.

With apologies to Philip K Dick :), this is a Karl-Thing, I think. 

--tom

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About