I'm trying to validate an email address using preg_match..
But i'm getting this error..
Warning: preg_match(): Unknown modifier '+'
This is my code
preg_match("[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", $email, $matches);
Can someone tell me what is wrong with my regex?
Thanks
spaceis a valid char in email..point is don't use regex to parse email..put it as simple as this.*@.*that's it@, which has to be a valid domain name, but yeah, pretty much anything goes on the left.