in reply to matching multiple patterns in one line
use warnings; use strict; my $line = '2011-01-01 15:34:554 some words and numbers then email@hos +t.com'; my @tokens = split /\s+/, $line; print join ' ', @tokens[0..1,-1], "\n"; __END__ 2011-01-01 15:34:554 email@host.com
|
|---|