diff options
author | Karl Williamson <public@khwilliamson.com> | 2010-09-23 23:36:40 -0600 |
---|---|---|
committer | Jesse Vincent <jesse@bestpractical.com> | 2010-10-15 23:14:29 +0900 |
commit | a12cf05f80a65e40fe339b086ab2d10e18d838c1 (patch) | |
tree | bd1254d24bac6bb121801a2a06d01c7e17703b92 /pod/perlunifaq.pod | |
parent | bdc22dd52e899130c8c4111c985fcbd7eec164a5 (diff) | |
download | perl-a12cf05f80a65e40fe339b086ab2d10e18d838c1.tar.gz |
Subject: [perl #58182] partial: Add uni \s,\w matching
This commit causes regex sequences \b, \s, and \w (and complements) to
match in the latin1 range in the scope of feature 'unicode_strings' or
with the /u regex modifier.
It uses the previously unused flags field in the respective regnodes to
indicate the type of matching, and in regexec.c, uses that to decide
which of the handy.h macros to use, native or Latin1.
I chose this for now rather than create new nodes for each type of
match. An earlier version of this patch did that, and in every case the
switch case: statements were adjacent, offering no performance
advantage. If regexec were modified to use in-line functions or more
macros for various short section of it, then it would be faster to have
new nodes rather than using the flags field. But, using that field
simplified things, as this change flies under the radar in a number of
places where it would not if separate nodes were used.
Diffstat (limited to 'pod/perlunifaq.pod')
-rw-r--r-- | pod/perlunifaq.pod | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/pod/perlunifaq.pod b/pod/perlunifaq.pod index 66d3b0f0dd..877e4d15e6 100644 --- a/pod/perlunifaq.pod +++ b/pod/perlunifaq.pod @@ -155,8 +155,7 @@ have furnished your own casing functions to override the default, these will not be called unless the UTF8 flag is on) This remains a problem for the regular expression constructs -C<\s>, C<\w>, C<\S>, C<\W>, C</.../i>, C<(?i:...)>, -and C</[[:posix:]]/>. +C</.../i>, C<(?i:...)>, and C</[[:posix:]]/>. To force Unicode semantics, you can upgrade the internal representation to by doing C<utf8::upgrade($string)>. This can be used |