Perl: grep()
grep()
# This example read in a file and prints out the lines that contain# the word "cat"
open (FH,"</usr/dict/words");@words = <FH>close(FH);
@lines = grep(/cat/,@words); # Note the pattern between "/ /"
print "The following lines contain the word \"cat\":\n";