Re: Assigning pattern matches to an array



Graham Stow wrote:

Emaill::Address doesn't grab me
Done a quick test between
use Email::Address
push(@matches, Email::Address->parse($line));
and
push(@matches, $line=~/\b[.-\w]*@[-\w]*\.+[-\w]*\.*[-\w]*\b/g);
The latter pulled up a number of correct email address, while the former
pulled these up plus other stuff that weren't true email addresses

Says you. I trust Email::Address's belief of what a "true" email
address is a hell of a lot better than yours. Just because they don't
look like what you might consider "normal" addresses doesn't mean they
aren't valid. Email::Address follows the RFC. Your handrolled
solution does not.

Paul Lalli

.