diff options
author | Karl Williamson <public@khwilliamson.com> | 2013-01-19 20:29:42 -0700 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2013-01-19 21:04:27 -0700 |
commit | 4d68ffa0f7f345bc1ae6751744518ba4bc3859bd (patch) | |
tree | f26602b7dbb509fd5be0a7bf4b3f4e7f29f92a3b /embed.h | |
parent | a8d9c7ae5b2de9d5434563530be821c884d9a6a7 (diff) | |
download | perl-4d68ffa0f7f345bc1ae6751744518ba4bc3859bd.tar.gz |
Deprecate certain rare uses of backslashes within regexes
There are three pairs of characters that Perl recognizes as
metacharacters in regular expression patterns: {}, [], and (). These
can be used as well to delimit patterns, as in:
m{foo}
s(foo)(bar)
Since they are metacharacters, they have special meaning to regular
expression patterns, and it turns out that you can't turn off that
special meaning by the normal means of preceding them with a backslash,
if you use them, paired, within a pattern delimitted by them. For
example, in
m{foo\{1,3\}}
the backslashes do not change the behavior, and this matches "f", "o"
followed by one to three more occurrences of "o".
Usages like this, where they are interpreted as metacharacters, are
exceedingly rare; we think there are none, for example, in all of CPAN.
Hence, this deprecation should affect very little code. It does give
notice, however, that any such code needs to change, which will in turn
allow us to change the behavior in future Perl versions so that the
backslashes do have an effect, and without fear that we are silently
breaking any existing code.
=head1 Performance Enhancements
Diffstat (limited to 'embed.h')
-rw-r--r-- | embed.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -965,7 +965,7 @@ #define grok_bslash_c(a,b,c) S_grok_bslash_c(aTHX_ a,b,c) #define grok_bslash_o(a,b,c,d,e,f,g) S_grok_bslash_o(aTHX_ a,b,c,d,e,f,g) #define grok_bslash_x(a,b,c,d,e,f,g) S_grok_bslash_x(aTHX_ a,b,c,d,e,f,g) -#define regcurly(a) S_regcurly(aTHX_ a) +#define regcurly(a,b) S_regcurly(aTHX_ a,b) # endif # if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_UTF8_C) #define _add_range_to_invlist(a,b,c) Perl__add_range_to_invlist(aTHX_ a,b,c) @@ -1615,7 +1615,7 @@ #define scan_ident(a,b,c,d,e) S_scan_ident(aTHX_ a,b,c,d,e) #define scan_inputsymbol(a) S_scan_inputsymbol(aTHX_ a) #define scan_pat(a,b) S_scan_pat(aTHX_ a,b) -#define scan_str(a,b,c,d) S_scan_str(aTHX_ a,b,c,d) +#define scan_str(a,b,c,d,e) S_scan_str(aTHX_ a,b,c,d,e) #define scan_subst(a) S_scan_subst(aTHX_ a) #define scan_trans(a) S_scan_trans(aTHX_ a) #define scan_word(a,b,c,d,e) S_scan_word(aTHX_ a,b,c,d,e) |