On 2009-08-19, Clemens Schwaighofer <clemens_schwaigho...@e-gra.co.jp> wrote: > On Wed, Aug 19, 2009 at 02:11, Randal L. Schwartz<mer...@stonehenge.com> > wrote: >>>>>>> "Andre" == Andre Lopes <lopes80an...@gmail.com> writes: >> >> Andre> I'm developing a function with some checks, for example... to check >> if the >> Andre> e-mail is valid or not. >> >> How are you hoping to do this? The regex to validate an email >> address syntactically is pretty large: >> >> http://ex-parrot.com/~pdw/Mail-RFC822-Address.html >> >> And no, I'm not kidding. If your regex is smaller than that, you aren't >> validating email... you're validating something "kinda like email". > > Just in my opinion, this regex is completely too large. For basic > validating something like: > ^[A-Za-z0-9!#$%&'*+-\/=?^_`{|}~][A-Za-z0-9!#$%&'*+-\/=?^_`{|}~\.]{0,6...@[a-za-z0-9-]+(\.[a-zA-Z0-9-]{1,})*\.([a-zA-Z]{2,4}){1}$ > works very well
not good: eg: fails this valid address* : ad...@xxxxxxx.museum accepts this invalid one : y...@gmail..com "musedoma" replaced with several x to protect the innocent from spam in some contexts email adrresses with no domain part are valid addresses with [bracketed] mx servers instead of a domain and/or bang paths are also allowed (but not in common use and often not desirable) -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general