Perl Programming | ||
---|---|---|
Regular Expressions | ||
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/ | Next |