The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
##############################################################################
#      $URL: http://perlcritic.tigris.org/svn/perlcritic/trunk/distributions/Perl-Critic/t/RegularExpressions/ProhibitEnumeratedClasses.run $
#     $Date: 2011-07-06 17:15:39 -0700 (Wed, 06 Jul 2011) $
#   $Author: wyant $
# $Revision: 4087 $
##############################################################################

## name basic passes
## failures 0
## cut

m/\w\d\p{Uppercase}/;
m/[\w\s]/;

#-----------------------------------------------------------------------------

## name allowed classes
## failures 0
## cut

m/[B-Y]/;
m/[0-8]/;
m/[\x{ffef}]/; # for code coverage

#-----------------------------------------------------------------------------

## name basic failures
## failures 8
## cut

m/[A-Z]/;      # \p{Uppercase}
m/[a-z]/;      # \p{Lowercase}
m/[0-9]/;      # \d
m/[A-Za-z0-9_]/;  # \w
m/[0-9a-z_A-Z]/;  # \w
m/[a-zA-Z]/;   # \p{Alphabetic}
m/[ \t\r\n\f]/;# \s
m/[\ \t\r\n]/; # \s

#-----------------------------------------------------------------------------

## name alterate representations of line endings
## failures 3
## cut

m/[\ \t\012\015]/; # \s
m/[\ \t\x0a\x0d]/; # \s
m/[\ \t\x{0a}\x{0d}]/; # \s

#-----------------------------------------------------------------------------

## name negative failures
## failures 8
## cut

m/[^\w]/;       # \W
m/[^\s]/;       # \S
m/[^0-9]/;      # \D
m/[^A-Za-z0-9_]/;  # \W
m/[^0-9a-z_A-Z]/;  # \W
m/[^a-zA-Z]/;   # \P{Alphabetic}
m/[^ \t\r\n\f]/;# \S
m/[^\ \t\r\n]/; # \S

#-----------------------------------------------------------------------------

## name special negative successes
## failures 0
## cut

m/[^\s\w]/;

#-----------------------------------------------------------------------------

## name failing regexp with syntax error
## failures 0
## cut

m/[^\w] (/;

#-----------------------------------------------------------------------------
# Local Variables:
#   mode: cperl
#   cperl-indent-level: 4
#   fill-column: 78
#   indent-tabs-mode: nil
#   c-indentation-style: bsd
# End:
# ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :