I need to validate a password field with pattern matching. I used ng-pattern for that. But it is not working properly.
See this pluker link
The pattern I gave here is, the text should contain at least 8 characters with symbols, alphabets and digits. But when I enter any string the pattern match become true.
See the following code
<body ng-controller="MainCtrl">
<form name="form">
<input type="text" name="password" ng-model="user.password" ng-pattern="/(^.*(?=.{8,})(?=.*\d)(?=.*[a-z])(?=.*[\W]).*$)/">
<input type="submit">
{{form.password.$error}}
</form>
</body>
What am I missing here?