I need help to create a regular expression to validate an input which can be:
- null,
- one email address,
- multiple email separated by commas.
These should be valid:
The regexp I found isn't working in dojo:
([-.%+_A-Za-z0-9]+@[-.A-Za-z0-9]+\.[A-Za-z]{1,6}|([,\s]+([-.%+_A-Za-z0-9]+@[-.A-Za-z0-9]+\.[A-Za-z]{1,6})*)*)
This is the html code:
<input dojotype="dijit.form.ValidationTextBox" invalidmessage="Really bad emails!!!" jsid="emailsValidationTextBox" name="emails" regexp="([-.%+_A-Za-z0-9]+@[-.A-Za-z0-9]+\.[A-Za-z]{1,6}|([,\s]+([-.%+_A-Za-z0-9]+@[-.A-Za-z0-9]+\.[A-Za-z]{1,6})*)*)" />
This is the link to a snapshot of my regexp in kregexpeditor
http://picasaweb.google.com/djpencho/Test/photo?authkey=AtpB9XtAwuM#5197...
Please help or I'll be fired :(

there is an email regexp in
there is an email regexp in dojox.validate.email (i think it gets provided as dojox.regexp.emailAddress or something)
one thing I know when using regexp="" in markup is you need to escape your slashes. all the \s 's need to be \\s and so on in order for the parser to interpret them correctly.
yesss!
yesss! dojox.regexp.emailAddressList does the work!
Thank you very much dante, you saved me! :D
i expect 10% of everything
i expect 10% of everything you make from now on, in light of you not getting fired ;)
glad it works out. BE CAREFUL: the dojox.regexp line of regexps (being provided by dojox.validate) break dojox namespace conventions and I've been meaning to shift it around to be either dojox.validate.regexp OR a new dojox.regexp project that dojox.validate requires
Regards