Unicode property problems in RegExp

Discussion in 'Perl Misc' started by vnick@freenet.de, Jun 3, 2005.

  1. Guest

    I have a problem with a relatively simple RE with Unicode Properties:

    [280] tmp% perl -Dr -e '$f = "KURZ_1"; if ($f =~ /[_\d\p{IsUpper}]+/)
    {print"$&\n"};' |& less

    [281] tmp%

    The RegExp debugger output shows this:

    Matching REx `[_\d\p{IsUpper}]+' against `KURZ_1'
    Matching stclass `ANYOF[0-9_{unicode}+utf8::IsDigit +utf8::IsUpper]'
    against `KURZ_1'
    Guessing start of match, REx `^_<' against
    `/cadappl/perl/5.8.5/lib/5.8.5/utf8.pm'...
    String not equal...
    Match rejected by optimizer


    So I made some more trials with UP RE's and their output is even
    stranger:

    [289] tmp% perl -e '$f = "KURZ"; if ($f =~ /[\p{IsUpper}]+/) {print
    "$&\n"};'

    @8(p
    [290] tmp% perl -e '$f = "KURZ"; if ($f =~ /\p{IsUpper}+/) {print
    "$&\n"};'

    [291] tmp% perl -e '$f = "KURZ"; if ($f =~ /\p{IsLu}+/) {print
    "$&\n"};'
    @4v
    [292] tmp% perl -e '$f = "KURZ"; if ($f =~ /(\p{IsLu}+)/) {print
    "$1\n"};'
    @1îd
    [293] tmp% perl -e '$f = "KURZ"; if ($f =~ /[A-Z]+/) {print "$&\n"};'
    KURZ
    [294] tmp%

    Anybody out there who can tell me what is wrong here?
    Thanks
    vnick
     
    , Jun 3, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. kevin  cline
    Replies:
    2
    Views:
    2,401
    Gilbert Rebhan
    Jul 26, 2008
  2. Greg Hurrell
    Replies:
    4
    Views:
    163
    James Edward Gray II
    Feb 14, 2007
  3. Mikel Lindsaar
    Replies:
    0
    Views:
    490
    Mikel Lindsaar
    Mar 31, 2008
  4. Joao Silva
    Replies:
    16
    Views:
    363
    7stud --
    Aug 21, 2009
  5. Ammar Ali
    Replies:
    3
    Views:
    105
    Ammar Ali
    Oct 23, 2010
Loading...

Share This Page