Jump to content

Preg_match problem


TomH

Recommended Posts

I am getting an error with preg_match, the error is:

 

Warning: preg_match() [function.preg-match]: Compilation failed: unmatched parentheses at offset 123 in /newsletter.php on line 16

 

Line 16 - if(preg_match('/\A(?:[a-zA-Z0-9]!#$%&\'*+\/=?^_`{|}~-])+(?:\.[a-zA-Z0-9]!#$%&\'*+\/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-z0-9])?\.))+(?:[a-zA-Z]{2}|com|org|net\b)\Z/i',$email)) return true;

 

Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/61017-preg_match-problem/
Share on other sites

Yeash...I havent looked at it in detail but as far as the extra parantheses goes...highlighted it for you...

 

if(preg_match('/\A(?:[a-zA-Z0-9]!#$%&\'*+\/=?^_`{|}~-])+(?:\.[a-zA-Z0-9]!#$%&\'*+\/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-z0-9])?\.))+(?:[a-zA-Z]{2}|com|org|net\b)\Z/i',$email))

 

 

Link to comment
https://forums.phpfreaks.com/topic/61017-preg_match-problem/#findComment-303623
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.