Regular expression validation in javascript failing in IE8
trying to use this
(^AD\\[a-zA-Z]+$)|(^ad\\[a-zA-Z]+$)|(^Ad\\[a-zA-Z]+$)
or
^(AD|ad\Ad)\\([a-zA-Z]+$)
in an attempt to validate for strings like AD\loginid or ad\loginid or
Ad\loginid
above regex works fine on the regex testers online.. like
http://regexpal.com/ or
http://www.regular-expressions.info/javascriptexample.html
but when I incorporate it in the script validations it fails for the below
code...
var lanidRegex = new
RegExp("(^AD\\[a-zA-Z]+$)|(^ad\\[a-zA-Z]+$)|(^Ad\\[a-zA-Z]+$)");
alert(lanidRegex.test("AD\loginid"));
I have rewritten the regex differently multiple times but to no luck..
No comments:
Post a Comment