Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Perl-Critic CPAN distribution.

Report information
The Basics
Id: 69322
Status: resolved
Priority: 0/
Queue: Perl-Critic

People
Owner: Nobody in particular
Requestors: rjray [...] blackperl.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.116
Fixed in: (no value)



Subject: RegularExpressions::ProhibitEnumeratedClasses false positive on [A-Za-z_]
The policy RegularExpressions::ProhibitEnumeratedClasses reports a false match against the pattern "[A-Za-z_]", suggesting the programmer use "\w" instead. However, these are not the same pattern-- "\w" is equivalent to "[A-Za-z0-9_]". I used the pattern "[A-Za-z_]" instead of "\w" specifically to avoid digits in the matched string. This is incorrect in both the code and the documentation. -- Randy J. Ray rjray@blackperl.com randy.j.ray@gmail.com
On Wed Jul 06 19:26:00 2011, RJRAY wrote: Show quoted text
> The policy RegularExpressions::ProhibitEnumeratedClasses reports a false > match against the pattern "[A-Za-z_]", suggesting the programmer use > "\w" instead. However, these are not the same pattern-- "\w" is > equivalent to "[A-Za-z0-9_]". I used the pattern "[A-Za-z_]" instead of > "\w" specifically to avoid digits in the matched string. This is > incorrect in both the code and the documentation.
Thank you for your report. You are quite right, of course. Correction committed as SVN revision 4087.
Fixed and released in Perl-Critic-1.117 -- Jeffrey Thalhammer Imaginative Software Systems www.imaginative-software.com