develooper Front page | perl.perl5.porters | Postings from November 2010

Re: ? RFC: Should a utf8 regex pattern with the /d modifier haveunicodesemantics?

Thread Previous | Thread Next
From:
Abigail
Date:
November 29, 2010 12:17
Subject:
Re: ? RFC: Should a utf8 regex pattern with the /d modifier haveunicodesemantics?
Message ID:
20101129201834.GA18489@almanda
On Mon, Nov 29, 2010 at 01:06:46PM -0700, karl williamson wrote:
> Abigail wrote:
>>
>> So, this will be fixed?
>>
>>     my $e  = "\xE8";
>>     my $re = "\N{WHITE SMILING FACE}";
>>
>>     say $e =~ /[\w$re]/ ? "Match" : "No match";
>>     say $e =~ /\w|$re/  ? "Match" : "No match";
>>
>>     __END__
>>     Match
>>     No match
>>
>>
> Well, in my undelivered code space they both match.  I don't understand  
> what the Match/No match is after the __END__.  If you think they should  
> return different values, please explain.


The output after the end is the output if you run the code in 5.12.x.
Which is a bug, as they should both match (assuming one wants UTF-8 
matching semantcis if at least one of the subject and regex has the 
UTF-8 flag set).



Abigail

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