Jump to content

Preg_Match() error... I can't get rid of it!


clonetrooper9494

Recommended Posts

I have an email validation preg_match() script...If you know preg_match() pretty well, have a look at my code:

/^(.+)(@)(.+)(.)[\.\](.+)$/

In other words, from the start of a value: look for 'wildcard' at least once (username of email address) , then look for @, then look for 'wildcard' at least once (domain name) , then look for a period ('.'), then look for 'wildcard' at least once (com, net ect.... still working on it, I know!)Question: how do you insert a period if in the code it's a wild card?

Link to comment
Share on other sites

You can escape it, like you did. Though you don't need that \ after it - this might work

/^(.+?)@(.+?)\.(.+?)$/

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...