www.perl.com
Perl Programming
Regular Expressions
  • Quantify matches
    • * matches the preceding character 0 or more times
    • + matches the preceding character 1 or more times
    • ? matches the preceding character 0 or once
    • {4} matches exactly 4 times
    • {3,6} matches 3 to 6 times

        my $string = "Did the fox jump over the dogs?";
        print "1: $string\n" if $string =~ m/z*/;         # matches
        print "2: $string\n" if $string =~ m/z+/;         # no match
        print "3: $string\n" if $string =~ m/\b\w{4}\b/;  # matches "jump"
      
Previous http://stuff.mit.edu/iap/perl/