# should work no matter where date, time, or email address is located in current line my $line = '2011-01-01 15:34:554 some words and numbers then email@host.com'; my @lines = split(/\s+/, $line); for(@lines){ print $_ . "\n" if /[0-9]{4}[-][0-9]{2}[-][0-9]{2}|[0-9]{1,2}[:][0-9]{1,2}[:][0-9]{1,3}|[@]/; }