develooper Front page | perl.perl5.porters | Postings from September 2012

[perl #114982] case-insensitive regex bug with UTF8-flagged strings

Thread Previous
From:
Peter Karman
Date:
September 20, 2012 11:13
Subject:
[perl #114982] case-insensitive regex bug with UTF8-flagged strings
Message ID:
rt-3.6.HEAD-11172-1348163162-1172.114982-75-0@perl.org
# New Ticket Created by  Peter Karman 
# Please include the string:  [perl #114982]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=114982 >


This is a bug report for perl from karman@cpan.org,
generated with the help of perlbug 1.39 running under perl 5.17.4.


-----------------------------------------------------------------
[Please describe your issue here]

Failing test below:

#!/usr/bin/env perl
use strict;
use warnings;
use Test::More tests => 2;

my $str     = ' Foo ';    # uppercase breaks 2nd regex
my $pattern = 'foo';
utf8::upgrade($str);
utf8::upgrade($pattern);

my $re          = qr/$pattern/i;
my $re_optional = qr/(?i:.?)$pattern/i;

like( $str, $re,          "re" );
like( $str, $re_optional, "re_optional" );



[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
     category=core
     severity=high
---
Site configuration information for perl 5.17.4:

Configured by pkarman at Thu Sep 20 12:22:16 CDT 2012.

Summary of my perl5 (revision 5 version 17 subversion 4) configuration:

   Platform:
     osname=linux, osvers=2.6.18-308.1.1.el5, archname=x86_64-linux
     uname='linux pkarmanpc.mpr.org 2.6.18-308.1.1.el5 #1 smp wed mar 7 
04:16:51 est 2012 x86_64 x86_64 x86_64 gnulinux '
     config_args='-des -Dprefix=/usr/local/perl/5.17.4 -Dusedevel'
     hint=recommended, useposix=true, d_sigaction=define
     useithreads=undef, usemultiplicity=undef
     useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
     use64bitint=define, use64bitall=define, uselongdouble=undef
     usemymalloc=n, bincompat5005=undef
   Compiler:
     cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector 
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
     optimize='-O2',
     cppflags='-fno-strict-aliasing -pipe -fstack-protector 
-I/usr/local/include'
     ccversion='', gccversion='4.1.2 20080704 (Red Hat 4.1.2-52)', 
gccosandvers=''
     intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
     d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
     ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', 
lseeksize=8
     alignbytes=8, prototype=define
   Linker and Libraries:
     ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
     libpth=/usr/local/lib /lib /usr/lib /lib64 /usr/lib64 /usr/local/lib64
     libs=-lnsl -ldb -ldl -lm -lcrypt -lutil -lc
     perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
     libc=/lib/libc-2.5.so, so=so, useshrplib=false, libperl=libperl.a
     gnulibc_version='2.5'
   Dynamic Linking:
     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
     cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib 
-fstack-protector'

Locally applied patches:


---
@INC for perl 5.17.4:
     /usr/local/perl/5.17.4/lib/site_perl/5.17.4/x86_64-linux
     /usr/local/perl/5.17.4/lib/site_perl/5.17.4
     /usr/local/perl/5.17.4/lib/5.17.4/x86_64-linux
     /usr/local/perl/5.17.4/lib/5.17.4
     .

---
Environment for perl 5.17.4:
     HOME=/home/pkarman
     LANG=en_US.UTF-8
     LANGUAGE (unset)
     LD_LIBRARY_PATH=/home/pkarman/sw/lib:
     LOGDIR (unset)
 
PATH=/home/pkarman/bin:/opt/perl/bin:/opt/pij/bin:/opt/subversion/bin:/opt/drupal/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin
     PERL_BADLANG (unset)
     SHELL=/bin/bash


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