Jump to content

Recommended Posts

http://www.php.net/manual/en/function.preg-match.php

 

Just use preg_match instead, and be aware that eregi was case insensitive, while preg_match is case sensitive.

It just means you need to add A-Z next to every time you use a-z, that is if you want to allow A-Z, but I suppose you do, because you were allowing that before.

 

"^[a-zA-Z0-9\._-]+@+[a-zA-Z0-9\._-]+\.+[a-zA-Z]{2,3}$"

 

Like that.

 

I don't think it's a safe code to validate input, because $ only match end of line, not end of string. \Z I think is end of string, and you should also use \A at the beginning instead of ^.

 

 

I also think there exists a function to validate emails without needing to use regex for it:

http://www.php.net/manual/en/function.filter-var.php

http://php.net/manual/en/filter.filters.validate.php

http://php.net/manual/en/filter.examples.validation.php

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.