On 2009-08-19, Clemens Schwaighofer <[email protected]> wrote:
> On Wed, Aug 19, 2009 at 02:11, Randal L. Schwartz<[email protected]> 
> wrote:
>>>>>>> "Andre" == Andre Lopes <[email protected]> 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* : [email protected]
accepts this invalid one  : [email protected]

"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 ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to