in reply to Only sometimes deprecated? "Unescaped left brace in regex is deprecated"
Quoting Karl Williamson from #128213 for perl5: No deprecation warning on literal left curly bracket in /.{/ etc:
So I tried to raise the warning only where the left brace could, with our plans, mean something other than a literal left brace. It turns out that there is lots of code like qr/{..../. That '{', since it's the first thing, can only be a left brace. And similarly in qr/^{.../ or qr/ ... ({...) .../, it can only be a left brace. So there is no need to disturb code where there is not going to be ambiguity. And this cuts down the amount of disruption significantly.
And quoting the 5.26.0 perldiag entry for "Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.30), passed through in regex":
... The contexts where no warnings or errors are raised are:
- as the first character in a pattern, or following ^ indicating to anchor the match to the beginning of a line.
- ...
Perhaps also relevant: #131352 for perl5: Unescaped literal "{" characters appear not always to be illegal.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Only sometimes deprecated? "Unescaped left brace in regex is deprecated"
by LanX (Saint) on Jun 02, 2017 at 18:53 UTC |