[Gllug] strip invalid email addresses

Nix nix at esperi.org.uk
Fri Dec 7 23:34:11 UTC 2007


On 7 Dec 2007, tethys at gmail.com uttered the following:
> This is actually harder than you'd expect (although not as hard as
> some misinformed pages on the net would have you believe). This is a
> simple regexp that will catch 99% of valid Internet email addresses.
> It's fine for filtering out valid addresses from a list like this
> (accepting that it'll miss a few valid ones), but don't even think
> about using it to validate an address in real time on a wbe form or
> similar, for example.
>
> sed -rn '/^.*@[-A-Za-z0-9]+\.[-A-Za-z0-9.]+$/p' addr.txt

Thank you, "Tethys the Sed Deity" <tethys@(not a real name)gmail.com>.

(I *think* that's still valid under RC2822.)

;}

-- 
`The rest is a tale of post and counter-post.' --- Ian Rawlings
                                                   describes USENET
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list