in reply to Simple search and output
perl -ne 'print if /regex/' testfile [download]
See perlrun for the switches, perlre for regex info, and print for printing.