in reply to Regex problem

I think you are looking for grep. See perldoc -f grep.

Update: not fast enough...