Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
problem with preg_match pattern for email validation
Old 01-27-2009, 02:18 PM problem with preg_match pattern for email validation
Skilled Talker

Posts: 83
Trades: 0
Hi,

I have this right now:
PHP Code:
if(preg_match("/^([a-zA-Z0-9])+([\.[a-zA-Z0-9_-]+])*@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)*\.([a-zA-Z]{2,6})$/"$val)) { 
But it does not match an address like test.test@test.com. What is wrong?

thanks!

Matt
killerwhale65 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-27-2009, 03:28 PM Re: problem with preg_match pattern for email validation
frofi's Avatar
Extreme Talker

Posts: 236
Location: London
Trades: 0
Try this:
Code:
[/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/i]
I've made it a long time ago and it never failed me.
__________________
THE FORCE is with me at last! All I need now is some TALKUPATION ;)
frofi is offline
Reply With Quote
View Public Profile
 
Old 01-28-2009, 08:26 AM Re: problem with preg_match pattern for email validation
Skilled Talker

Posts: 83
Trades: 0
thanks!
killerwhale65 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to problem with preg_match pattern for email validation
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.18846 seconds with 12 queries