From: | Clemens Schwaighofer <clemens_schwaighofer(at)e-gra(dot)co(dot)jp> |
---|---|
To: | "Randal L(dot) Schwartz" <merlyn(at)stonehenge(dot)com> |
Cc: | Andre Lopes <lopes80andre(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: Postgre RAISE NOTICE and PHP |
Date: | 2009-08-20 00:03:43 |
Message-ID: | 4A8C92DF.9050403@e-gra.co.jp |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On 08/19/2009 11:41 PM, Randal L. Schwartz wrote:
>>>>>> "Clemens" == Clemens Schwaighofer <clemens_schwaighofer(at)e-gra(dot)co(dot)jp> writes:
>
> Clemens> Just in my opinion, this regex is completely too large. For basic
> Clemens> validating something like:
> Clemens> ^[A-Za-z0-9!#$%&'*+-\/=?^_`{|}~][A-Za-z0-9!#$%&'*+-\/=?^_`{|}~\.]{0,63}(at)[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]{1,})*\.([a-zA-Z]{2,4}){1}$
> Clemens> works very well
>
> Fails on ".mobile" TLD. Has a pointless {1} in it, which does
> absolutely nothing, providing that the creator of the regex was already
> missing a few clues.
>
> That's the problem with these kinds of regex... you test it on what
> you know, but you're not consulting the *actual* *internet* specifications
> (which have been readily available since the dawn of Internet time).
>
> Either use the regex I pointed to already, or stay with the simpler:
>
> /\S(dot)*(at)(dot)*\S/
>
> which will at least not deny anyone with a *perfectly legitimate* email
> address from making it into your system.
>
> Or, use your regex *only* in an *advice* category, with the ability
> for the user to say "yes, I'm really sure this is my address".
>
> Please, for the sake of the net, do the Right Thing here. This is
> what I'm arguing for. Anything less than that, and your code deserves
> to end up in thedailywtf.com as an example of what *not* to do.
I am not going to defend any regex here, but in my opinion it helps on
what I want to see in email addresses.
Yes it fails on mobile, but I have not yet seen one. Probably the best
thing is to test nothing at all. Just accept it ...
--
[ Clemens Schwaighofer -----=====:::::~ ]
[ IT Engineer/Web Producer/Planning ]
[ E-Graphics Communications SP Digital ]
[ 6-17-2 Ginza Chuo-ku, Tokyo 104-8167, JAPAN ]
[ Tel: +81-(0)3-3545-7706 Fax: +81-(0)3-3545-7343 ]
[ http://www.e-gra.co.jp ]
From | Date | Subject | |
---|---|---|---|
Next Message | Stephen Cook | 2009-08-20 00:10:14 | Re: Temp table or normal table for performance? |
Previous Message | Greg Smith | 2009-08-20 00:01:31 | Re: Stock Market Price Data & postgreSQL? HELLPPP Please |