Questions tagged [angularjs-ng-pattern]

An optional directive that can be used to check values for input: Input control follows HTML5 input types and polyfills the HTML5 validation behavior for older browsers.

Sets pattern validation error key if the ngModel value does not match a RegExp found by evaluating the Angular expression given in the attribute value. If the expression evaluates to a RegExp object, then this is used directly. If the expression evaluates to a string, then it will be converted to a RegExp after wrapping it in ^ and $ characters. For instance, "abc" will be converted to new RegExp('^abc$').

Note: Avoid using the g flag on the RegExp, as it will cause each successive search to start at the index of the last search's match, thus not taking the whole input value into account.

50 questions
-1
votes
2 answers

Conditional ngPattern

Following this bit of code:
Rafael Herscovici
  • 16,558
  • 19
  • 65
  • 93
-1
votes
1 answer

Regular Expression Generation for AngularJS ng-pattern

I'm using a regex to validate a form input. So basically a user can input "SELECT some_name of select_match". So far I have the regex: \bSELECT\b \bof select_match\b The last part is the middle part, which I think should be [a-zA-Z] but I'm not sure…
D. Gal
  • 329
  • 2
  • 14
-1
votes
1 answer

validation for email and mobile no in single inputbox using angularjs

How can I validate emailid and mobile no both in a single input box in AngulaJS? I'm trying to validate emaild and mobile no in same input box. it is working fine seperately, but for both emaild and mobile it doesn't work.
jay
  • 1
-1
votes
1 answer

ng-pattern not matching the correct regex

I am using a form to get user details. In my name input I want only alphabetic characters, spaces and apostrophe. So I created the form input like
Muhammad Raihan Muhaimin
  • 5,559
  • 7
  • 47
  • 68
-2
votes
1 answer

Match an expression with no << or ]]

I need to match the pattern only if << or >> or ]] or [[ is not present in the string. If any of these special characters are present the match should be zero else it should match. For example, I have an expression Stackoverflow which should return…
user4895544
  • 103
  • 1
  • 11
1 2 3
4