This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
New regex experimental feature: (?[ ])
authorKarl Williamson <public@khwilliamson.com>
Fri, 11 Jan 2013 00:06:04 +0000 (17:06 -0700)
committerKarl Williamson <public@khwilliamson.com>
Fri, 11 Jan 2013 18:50:38 +0000 (11:50 -0700)
commit9d1a5160ac870eccea399973eaa9f9e3020b0833
tree9d08b87e7c229f41ee345da68b7de257a585a21b
parentab6629666cee2471e467421195a7a99662521188
New regex experimental feature: (?[ ])

This is a fancier [bracketed] character class which allows set
operations, such as intersection and subtraction.  The entry in perlre
for this commit details its operation.

Besides extending regular expressions to handle this functionality,
recommended by Unicode, the intent here is to do three things:

1) Intersection has been simulated by regexes using zero-width
   look-around assertions, which are non-obvious.  This allows replacing
   those with a more powerful and clearer syntax; the compiled regexes
   are smaller and faster.  Everything is known at compile time.
2) Set operations have also been simulated by using user-defined Unicode
   properties.  These are globals, have security implications,
   restricted names, and d don't allow as complex expressions as this
   new feature.
3) I hope that this feature will come to be viewed as a "better"
   bracketed character class.  I took advantage of the fact that there
   is no embedded base to have to be compatibile with to forbid certain
   iffy practices with the existing ones, while remaining mostly
   backwards compatible.  The main difference is that /x is always
   enabled, so white space can be pretty much freely used with these,
   but to specify a match on white space, it must be escaped.  Things
   that should have been illegal are, such as \x{}, and \x{abcdefghi}.
   Things that look like a posix specifier but don't quite meet the
   rules now give an error instead of silently compiling. e.g., [:digit]
   is an error instead of the union of the characters that compose it.
   I may have omitted things; perhaps it should be an error to have the
   same letter occur twice, adjacent.  Since this is experimental, we
   can make such changes based on field feed back.

The intent is to keep this feature, since it is strongly recommended by
Unicode.  The exact syntax is subject to change, so is experimental.
MANIFEST
embed.fnc
embed.h
pod/perldelta.pod
pod/perlre.pod
pod/perlunicode.pod
proto.h
regcomp.c
t/porting/diag.t
t/re/regex_sets.t [new file with mode: 0644]