Regex for email validation not working in Spring DOJO

I want to validate an email address using Spring Decoration of DOJO framework. but the regex which used to work in normal validation is not working.

Spring.addDecoration(new Spring.ElementDecoration({
elementId: “emailAddress”,
widgetType: “dijit.form.ValidationTextBox”,
widgetAttrs:
{
regExp : “/^[w.=-]+@[w.-]+.[w]{2,4}$/”,
required:”true”,
invalidMessage:”Invalid format for email Address.
“,
trim:”true”
}
}));

Pls let me know Why my regExp is not working here in Spring decoration of DOJO?


Source: regex

Leave a Reply