|
SA Bugzilla – Full Text Bug Listing |
Summary: | Unescaped left brace in regex is deprecated | ||
---|---|---|---|
Product: | Spamassassin | Reporter: | chorny <alexchorny> |
Component: | Libraries | Assignee: | SpamAssassin Developer Mailing List <dev> |
Status: | RESOLVED DUPLICATE | ||
Severity: | normal | CC: | alexchorny, billcole, jhardin, jquinn+SAbug, lista, philip |
Priority: | P2 | ||
Version: | unspecified | ||
Target Milestone: | Undefined | ||
Hardware: | PC | ||
OS: | All | ||
Whiteboard: |
Description
chorny
2016-11-11 22:28:32 UTC
...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 |