perl -ne 'print if /regex/' testfile