in reply to grep question using multiple lines
use a proper email parser:
My example parse all emails out of the text and then print only the email addresses, that start with constant=
output:use Email::Address; my @add = Email::Address->parse(<<'__TXT__'); f834bkg94halUF9deju hHFDUO()NFRS432 DSFadsfg94hHFDUO()N hfedls74d8oHFx constant=barney@gmail.com alUF9dejuH()NF UO()NFRS432 DSFadsf4halUF9deju fedls74d8oH sfg94hHFDUOf f834bkg94halUF9deju hHFDUO()NFRS432 DSFadsfg94hHFDUO()N hfedls74d8oHFx constant=wilma@aol.com alUF9dejuH()NFui0 UO()NFRS432 DSFadsf4halUF9deju fedls74d8oH sfg94hHFDUOf __TXT__ for my $add (@add) { local $_ = $add->address; next unless s/^constant=//; print $_, $/; }
barney@gmail.com wilma@aol.com
Boris
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: grep question using multiple lines
by bradcathey (Prior) on Dec 28, 2008 at 02:00 UTC | |
by Anonymous Monk on Dec 28, 2008 at 11:04 UTC |
In Section
Seekers of Perl Wisdom