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

Re: fold case matching

Thread Previous
From:
H.Merijn Brand
Date:
April 27, 2010 09:39
Subject:
Re: fold case matching
Message ID:
20100427183942.14f5481f@pc09.procura.nl
On Tue, 27 Apr 2010 17:17:18 +0100, Dave Mitchell <davem@iabyn.com>
wrote:

> Just out of curiosity, which perl (if any) is doing the Right Thing
> as regards the following code, which matches a char that case folds to two
> chars:
> 
>     # lc("\x{149}") => "\x{2bc}N"
> 
>     print "ok PLAIN 1\n" if "\x{149}" =~ /\x{2bc}/i;
>     print "ok PLAIN 2\n" if "\x{149}" =~ /N/i;
>     print "ok PLAIN 3\n" if "\x{149}" =~ /\x{2bc}N/i;
> 
>     print "ok ALT   1\n" if "\x{149}" =~ /\x{2bc}|ZZZZ/i;
>     print "ok ALT   2\n" if "\x{149}" =~ /N|ZZZZ/i;
>     print "ok ALT   3\n" if "\x{149}" =~ /\x{2bc}N|ZZZZ/i;
> 
> 
> 5.8.0,
> 5.13.0,
> blead:
> 
>     ok PLAIN 3
>     ok ALT   1
>     ok ALT   3
> 
> 5.10.0,
> 5.10.1,
> 5.12.0:
> 
>     ok PLAIN 1
>     ok PLAIN 3
>     ok ALT   1
>     ok ALT   3
> 
> (This is in the context me me trying to understand and fix the trie code
> for [perl #74484] Regex causing exponential runtime+mem usage.)

Just for the sake of completeness:

=== base/perl5.8.1
=== base/perl5.8.2
=== base/perl5.8.3
=== base/perl5.8.4
=== base/perl5.8.5
=== base/perl5.8.6
=== base/perl5.8.7
=== base/perl5.8.8
=== base/perl5.8.9
ok PLAIN 3
ok ALT   1
ok ALT   3

=== base/perl5.10.0
=== base/perl5.10.1
=== base/perl5.11.0
=== base/perl5.11.1
=== base/perl5.11.2
=== base/perl5.11.3
=== base/perl5.11.4
=== base/perl5.11.5
=== base/perl5.12.0
ok PLAIN 1
ok PLAIN 3
ok ALT   1
ok ALT   3

-- 
H.Merijn Brand  http://tux.nl      Perl Monger  http://amsterdam.pm.org/
using 5.00307 through 5.12 and porting perl5.13.x on HP-UX 10.20, 11.00,
11.11, 11.23, and 11.31, OpenSuSE 10.3, 11.0, and 11.1, AIX 5.2 and 5.3.
http://mirrors.develooper.com/hpux/           http://www.test-smoke.org/
http://qa.perl.org      http://www.goldmark.org/jeff/stupid-disclaimers/

Thread Previous


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