Help for this page

Select Code to Download


  1. or download this
    my $rx = qr/
        ([abcd])           # a, b, c, or d -- stored in \1
    ...
        (?!\1|\2|\3)       # next thing not \1, \2, or \3
        [abcd]             # you get the idea
        /x;
    
  2. or download this
    use List::Util qw( shuffle );
    use Test::More;
    ...
        my $s = join q{}, shuffle 0 .. 9, qw( a b c d );
        ok( $s =~ $rx, "match '$s'" );
    }