This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
PATCH: [perl #89774] multi-char fold + its fold in char class
authorKarl Williamson <public@khwilliamson.com>
Fri, 12 Oct 2012 03:49:31 +0000 (21:49 -0600)
committerKarl Williamson <public@khwilliamson.com>
Sun, 14 Oct 2012 15:03:37 +0000 (09:03 -0600)
commit9d53c4576e551530162e7cd79ab72ed81b1e1a0f
treeee325930d7e69d86ff1ce9c69efc671fc1d3776b
parent9ffebac4d942e0e3785b33375ecf7c9fba8711f7
PATCH: [perl #89774] multi-char fold + its fold in char class

The design for handling characters that fold to multiple characters when
the former are encountered in a bracketed character class is defective.
The ticket reads, "If a bracketed character class includes a character
that has a multi-char fold, and it also includes the first character of
that fold, the multi-char fold will never be matched; just the first
character of the fold.".   Thus, in the class /[\0-\xff]/i, \xDF will
never be matched, because its fold is 'ss', the first character of
which, 's', is also in the class.

The reason the design is defective is that it doesn't allow for
backtracking and trying the other options.

This commit solves this by effectively rewriting the above to be
/ (?: \xdf | [\0-\xde\xe0-\xff] ) /xi.  And so the backtracking gets
handled automatcially by the regex engine.
embedvar.h
intrpvar.h
pod/perldelta.pod
pod/perlre.pod
pod/perlrecharclass.pod
regcomp.c
sv.c
t/re/re_tests