views:

35

answers:

0

I am trying to use ASP MVC 2 data annotations to validate a semicolon delimited list of email addresses on the client side. The regex below works on the server side but doesn't work with the javascript because javascript regular expressions don't support conditionals.

"^([A-Za-z0-9_\+\-]+(\.[A-Za-z0-9_\+\-]+)@[A-Za-z0-9-]+(\.[A-Za-z0-9]+)\.([A-Za-z]{2,4})(?(?=.);[ ]*|))+$"

Is there a way to require that the email address is followed by a semicolon only if it is followed by another email address without using a conditional? Thanks.