SA Bugzilla – Bug 7369
Unescaped left brace in regex is deprecated
Last modified: 2018-04-19 17:57:53 UTC
This is new warning in 5.24 and in 5.26 it will be fatal error. Unescaped left brace in regex is deprecated here, passed through in regex; marked by <-- HERE in m/^(.{ <-- HERE ,200}).*$/ at ../blib/lib/Mail/SpamAssassin/PerMsgStatus.pm line 921. See for ex. http://www.cpantesters.org/cpan/report/2175cb2a-69fe-11e6-b500-799f71b19ea6
...so now you have to explicitly say ".{0,nnn}" for "0-n instances of"? How many REs does this change break worldwide?
Looks like it. The perlre documentation does not mention the {,n} quantifier syntax, back as far as 5.12. I don't know when that change occurred, but it looks like we need to clean up the code and potentially the rules to do explicit {0,n} quantifiers, and post a warning on the users list for people to review their local rules. How many versions back do we fix this?
(In reply to John Hardin from comment #1) > ...so now you have to explicitly say ".{0,nnn}" for "0-n instances of"? Tested /a{,2}/ on perl 5.14.0. It does not work as /a{0,2}/. But it is same as /a\{,2\}/.
...ugh. Is that sed I'm remembering then that supports the {,n} syntax?
$ grep --recursive '{,' lib/ lib/Mail/SpamAssassin/PerMsgStatus.pm: $str =~ s/^(.{,200}).*$/$1/gs; Looks like this is the only regex that is affected.
(In reply to chorny from comment #3) > Tested /a{,2}/ on perl 5.14.0. It does not work as /a{0,2}/. But it is same > as /a\{,2\}/. "does not work" is surely defined by the comment above the failed regex: # in case the last line was huge, trim it back to around 200 chars and "{,2}" does not work to trim the line in earlier version of perl either. To trim the line to 200 chars "s/^(.{0,200}).*$/$1/gs" should be correct. Any reason why something so basic has been left for 8 month? Is spamassassin unmaintained? Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.30), passed through in regex; marked by <-- HERE in m/^(.{ <-- HERE ,200}).*$/ at /opt/xxxx/lib/perl5/xxxx/Mail/SpamAssassin/PerMsgStatus.pm line 921. Note: and will be **fatal** in Perl 5.30
Fixed in r1791013 for Bug #7404 *** This bug has been marked as a duplicate of bug 7404 ***
*** Bug 7576 has been marked as a duplicate of this bug. ***