Jquery can validate email addresses:
http://docs.jquery.com/Plugins/Validation
What regular expression (if any) does jQuery use for their email validation?
I’d like to do something similar, except using javascript regex.
Thanks!
update:
Why do I ask?
I’m using it for the pattern attribute of my <input> elements.
I ended up using this:
^\S+@(([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6})$
It uses this regex borrowed from Scott Gonzalez…
Source.
There is no difference between a regex used in a jQuery plugin than a normal JavaScript regex.