develooper Front page | perl.perl5.porters | Postings from July 2013

[perl #118667] doc and code mismatch on some space character( classe)s

Thread Previous
From:
Steffen "Daode" Nurpmeso
Date:
July 2, 2013 17:21
Subject:
[perl #118667] doc and code mismatch on some space character( classe)s
Message ID:
rt-3.6.HEAD-2552-1372430164-998.118667-75-0@perl.org
# New Ticket Created by  Steffen "Daode" Nurpmeso 
# Please include the string:  [perl #118667]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=118667 >


Hello,
there is something i don't understand.  Thank you.

  $ perl -e 'print "$^V:";$i="\x{00A0}"'\
      -e ';if($i=~/[[:space:]]/){print "1"}'\
      -e ';if($i=~/\s/){print "2"}'\
      -e ';if($i=~/\p{IsSpace}/){print "3"}'\
      -e ';print "\n"'
    :3 <- 5.8.9 (-))
  v5.10.0:3
  v5.16.1:3
  v5.18.0:3

Also in respect to a doc mismatch in 5.10.0, 5.16.1 and still in
5.18.0 (perlre manual):

  The following equivalences to Unicode \p{} constructs and
  equivalent backslash character classes (if available), will
  hold:
  ...
  space       IsSpace
              IsSpacePerl    \s
  ...
  You can negate the [::] character classes by prefixing the class
  name with a '^'. This is a Perl extension.  For example:
  ...
  [[:^space:]]    \S         \P{IsSpace}

Also note that `Z' includes `Zl' (U+2028) and `Zp' (U+2029), so
that the following from the perlretut manual i don't understand:

  Perl class name  Unicode class name or regular expression
  ...
  IsSpace          /^Z/ || ($code =~ /^(0009|000A|000B|000C|000D)$/
  IsSpacePerl      /^Z/ || ($code =~ /^(0009|000A|000C|000D|0085|2028|2029)$/

--steffen


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