MVC4 Razr throws error on AngularJS email regex pattern -
In my MVC4 view, I'm able to validate my form fields using AngularJS. Everything works great except for email verification. I am using AngularJS v1.2.26 within the MVC4 project. Here I am using the ridge pattern. ng-pattern = "/ ^ [_ a-z0- 9] + (\. [_A-z0-9] +) * @ [a-z0-9 -] + (\ [One- Z0- 9 -]. +) * (\ [Az] {2,4}.) $ / ". My problem is that in the browser I get a runtime error when the razor hits the '@' symbol in the ragex pattern and blows the page. Any help would be great. Thanks!
@ razor syntax has a special symbol to use it on page Just use a double
@@ like this:
ng-pattern = "/ ^ [_ a-z0-9] + (\. [ _a-Z0-9] +) * @@ [one-Z0-9 -] (\ [one-z0-9 -] .. +) * (\ [az] {2,4}) $ / "
Comments
Post a Comment