[pLog-svn] Email Regex

Jon Daley plogworld at jon.limedaley.com
Tue Jul 18 15:04:37 GMT 2006


 	I would bet we don't want to depend on PEAR for just email 
validation.  We want to have as minimum external dependencies as possible.

What are the invalid email addresses that pass the regex?

We could change it to this pretty easily:
"^[a-z0-9]*([_.+-]+[a-z0-9])+@[a-z0-9]+([-.]?[a-z0-9])+\.[a-z]{2,4}"

The full expression from the RFC is about a page long, we could include 
that if needed to.  I think it is overkill for the real world.

On Tue, 18 Jul 2006, Ammar Ibrahim wrote:

> The regex for the email validation rule is flawed.
>
>   define( "EMAIL_FORMAT_RULE_REG_EXP",
> "^[a-z0-9]*([-_.+]?[a-z0-9])+@[a-z0-9]+([-.]?[a-z0-9])+\.[a-z]{2,4}");
>
> Not only some invalid emails pass this regex, yet worse, some valid emails
> don't pass e.g. (ab__ar at hotmail.com, note the double underscores)
>
> My suggestion would be to use the PEAR email validator, I've used it quite
> alot and it looks to be very good and intensive. The validator package is
> big, so we can just take the email validation part and integrate it in
> LifeType. If this is what we agree on, I can work on this and send you the
> code.
>
>
> - Ammar
>

-- 
Jon Daley
http://jon.limedaley.com/

"Diplomacy" is letting them have it your way.


More information about the pLog-svn mailing list