[ale] Code/logic collection question
greg at turnstep.com
greg at turnstep.com
Mon Apr 23 20:45:50 EDT 2001
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
> BTW - what is the regular expression for a valid email
> address? I'm afraid it was beating me up under grep.
As someone already mentioned, the proper one is from
the book _Mastering Regular Expressions_: the link
I provided in my previous email was to a page of the
author's that breaks it down a bit.
Here it is again:
http://public.yahoo.com/~jfriedl/regex/email-opt.pl
This is one of those problems that sounds easy on the
surface, but the devil is in the details. Something
as simple as
[^@\s]+@[\w\.]+
is probably your best bet. For real power, grab a module.
(It's tempting to keep "fixing" the regular expression
above, but once you start down that road, you won't
escape for literally hundreds of characters later. :)
Greg Sabino Mullane
greg at turnstep.com
PGP Key: 0x14964AC8 200104231940
-----BEGIN PGP SIGNATURE-----
Comment: http://www.turnstep.com/pgp.html
iQA/AwUBOuS92bybkGcUlkrIEQJqUACfX1SCx5xSmqmQWeR+k+q/mQ3jRWgAoO3P
IXOr3HPVEJt/5OFp4ZesQkRE
=eoip
-----END PGP SIGNATURE-----
--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.
More information about the Ale
mailing list