PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
hame22
Forum Contributor
Posts: 214 Joined: Wed May 11, 2005 5:50 am
Post
by hame22 » Mon Mar 05, 2007 9:28 am
Hi
My current email validation script will not allow any emails with a ' in to be validate e.g.(a.o'
reilly@domain.com ).
I'm currently using:
Code: Select all
(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,6})$", $email))
any ideas?
Thanks in advance
Kieran Huggins
DevNet Master
Posts: 3635 Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:
Post
by Kieran Huggins » Mon Mar 05, 2007 9:31 am
adding a ' to your character class should do the trick
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Mon Mar 05, 2007 9:49 am
Duplicate thread. Locked.