This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Warn on unescaped /[]}]/ under re strict
This commit generates a warning when the experimental 're strict'
feature is in effect for unescaped '}' and ']' characters (in a regular
expression pattern) that are interpreted literally.
This brings the behavior of these more in line with ')' which croaks
when it is taken literally.
The problem with the existing behavior is that these characters may be
metacharacters or they may be literals, depending on action at a
distance. Not so with ')', which is always a metacharacter unless
escaped.
Ideally, all three of these characters should behave similarly, but it
really is too late for that, except we can warn if the user has
requested extra checking of their patterns with this experimental
're strict' feature.