Page is a not externally linkable
- Code, Content, and Presentation
-- JavaScript and AJAX
---- A Universal Script for Javascript Form Validation


Fotiman - 3:26 pm on Sep 24, 2008 (gmt 0)



* = a letter
# = a number
@ = either
anything else = itself

If it were me, I would swap * and @, because to me @ looks more like a letter and * is traditionally a wildcard to mean anything. So:

@ = a letter
# = a number
* = either
anything else = itself

But what if the "anything else" contains one of the tokens characters? For example, what if I wanted to match a string like:

"Fotiman@example.com"

I would suggest that if you're going to go the route or creating your own regex language, you'd need to specify an escape character as well. For example:

@ = a letter
# = a number
* = either
anything else = itself
\@ = a literal "@"
\# = a literal "#"
\* = a literal "*"
\\ = a literal "\"


Thread source:: http://www.webmasterworld.com/javascript/3749043.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com