This repository was archived by the owner on Jun 1, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 17
Less m/{}/ Unescaped left brace in regex is deprecated here warnings #362
Comments
Note that p5p decided on the opposite, to make these harmful unnecessary warnings even fatal with 5.30. |
rurban
added a commit
that referenced
this issue
Oct 4, 2018
Only check for Name: \N{} Property: \p{}, \P{} Break: \b{}, \B{} Code: \x{}, \o{} Group: \g{} and allow other chars before a { automake and more widespread utils does not need to be plagued by spurious "Unescaped left brace in regex" warnings, when they dont need to be quoted. Undeprecate those new errors, there's nothing more to reserve (yet). strpbrk is C89. Fixes [cperl #362]
Merged into v5.29.0c, should be backported to v5.28.1c too |
rurban
added a commit
that referenced
this issue
Oct 5, 2018
Only check for Name: \N{} Property: \p{}, \P{} Break: \b{}, \B{} Code: \x{}, \o{} Group: \g{} and allow other chars before a { automake and more widespread utils does not need to be plagued by spurious "Unescaped left brace in regex" warnings, when they dont need to be quoted. Undeprecate those new errors, there's nothing more to reserve (yet). strpbrk is C89. Fixes [cperl #362] (cherry picked from commit 17e2b8d)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
automake and more widespread utils does not need to be plagued by spurious "Unescaped left brace in regex" warnings, when they don't need to be quoted.
The few cases where
{
is used for a special unicode group can be easily detected in regcomp.Name:
\N{}
Property:
\p{}, \P{}
Break:
\b{}, \B{}
Code:
\x{}
,\o{}
Group:
\g{}
perlre.pod:
(If a curly bracket occurs in any other context and does not form part of a
backslashed sequence like "\x{...}", it is treated as a regular character.
However, a deprecation warning is raised for all such occurrences, and in Perl
v5.26, literal uses of a curly bracket will be required to be escaped, say by
preceding them with a backslash ("{") or enclosing them within square brackets
("[{]"). This change will allow for future syntax extensions (like making the
lower bound of a quantifier optional), and better error checking of quantifiers.)
perldiag.pod:
Unescaped left brace in regex is illegal here in regex; marked by <-- HERE
in m/%s/
For the proposed extensions: optional lower bound of a quantifier
{,\d}
, and better error checking of quantifiers we need{,
or{\d
, not justifying punishing all old usages ofhash{key}
, esp. since those keys are not literal numbers or commas.The text was updated successfully, but these errors were encountered: