http://www.perlmonks.org?node_id=1002485


in reply to Regex to remove data

Also, don’t overlook the obvious grep (or egrep) commands, if you have them on your system . . . You might not have to “write a program” to do this at all.   Simply use the -v option to output all lines which don’t match the pattern.