Perl Programming | ||
---|---|---|
Regular Expressions | ||
my $string = "Did the fox jump over the dogs?"; print "1: $string\n" if $string =~ /dog/; # matches print "2: $string\n" if $string =~ m/dog/; # matches print "3: $string\n" if $string =~ m(dog); # matches print "4: $string\n" if $string =~ m|dog|; # matches |
||
Previous | http://stuff.mit.edu/iap/perl/ | Next |