Hello Monks, I am trying to extract dates/times and email addresses from a log file. the format is like this: 2011-01-01 15:34:554 some words and numbers then email@host.com I would like to print the date, time, email address. I have something that is printing the email address but I cannot seem to be able to get the other 2 fields that i need. Kindly help when you get a moment. thanks, Jose. this is what i have
while (my $line = <>) { foreach my $output (split /\s+/, $line) { if ($output =~ /^[-\w.]+@([a-z0-9][a-z-0-9]+\.)+[a-z]{ +2,4}$/i) { print $output . "\n";
In reply to matching multiple patterns in one line by jose_m
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |