File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -96,11 +96,12 @@ var requiredDirective = function() {
96
96
* It is most often used for text-based {@link input `input`} controls, but can also be applied to custom text-based controls.
97
97
*
98
98
* The validator sets the `pattern` error key if the {@link ngModel.NgModelController#$viewValue `ngModel.$viewValue`}
99
- * does not match a RegExp which is obtained by evaluating the AngularJS expression given in the
100
- * `ngPattern` attribute value:
101
- * * If the expression evaluates to a RegExp object, then this is used directly.
102
- * * If the expression evaluates to a string, then it will be converted to a RegExp after wrapping it
103
- * in `^` and `$` characters. For instance, `"abc"` will be converted to `new RegExp('^abc$')`.
99
+ * does not match a RegExp which is obtained from the `ngPattern` attribute value:
100
+ * - the value is an AngularJS expression:
101
+ * - If the expression evaluates to a RegExp object, then this is used directly.
102
+ * - If the expression evaluates to a string, then it will be converted to a RegExp after wrapping it
103
+ * in `^` and `$` characters. For instance, `"abc"` will be converted to `new RegExp('^abc$')`.
104
+ * - If the value is a RegExp literal, e.g. `ngPattern="/^\d+$/"`, it is used directly.
104
105
*
105
106
* <div class="alert alert-info">
106
107
* **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to
You can’t perform that action at this time.
0 commit comments