Skip to main content
0 votes
1 answer
257 views

Angularjs: Validation for Mac address not working

I have a form to add device mac address and wifi mac address, but I like to put a validation for the input-form, just to accept alphanumeric values on this pattern 'xx:xx:xx:xx:xx:xx'. I originally ...
Sami's user avatar
  • 341
1 vote
1 answer
36 views

regex look-behind expression incompatibily with IE

I am using this regex expression for an input. When I try it in Chrome, it works well, but not when I try in IE. The regex editor that I am using advice me that the negative look-behind expression ...
jsdj21's user avatar
  • 13
1 vote
1 answer
110 views

ng-pattern for PCRE

I have this pattern for an input text field: /[\p{L}\'.\- ]{3,30}/ My intention is to accept the most broadly names of people on several alphabets of the world (Latin, Cyrillic, Chinese, etc.) It was ...
limakid's user avatar
  • 81
0 votes
0 answers
82 views

Angular js form validation without html form

I have an input tag <div class="form-group" ng-form name="patientLinkingForm"> <input type=&...
Ishmeet Singh's user avatar
0 votes
0 answers
20 views

How to disallow space using ng-pattern

I have belopw ng-pattern set in one of my form field. It gives validation error on field if user enters non numeric value. If i just put empty string and validate, it doesnot show any validation error ...
rajesh desai's user avatar
1 vote
0 answers
48 views

ng-pattern does not work when pattern set dynamically in ng-repeat

I have some sets of patterns in my controller. I am trying to set this pattern dynamically for ng-pattern using ng-repeat. Pattern example : $scope.codePattern = (function () { var regexp = /^([a-zA-...
user14118739's user avatar
0 votes
0 answers
70 views

Browser hangs while using ng-pattern in angularjs

Input field using ng-pattern as <input name="name" ng-model="name" type="text" maxlength="50" ng-required="true" ng-pattern="/^([a-zA-Z0-9_-]+...
Sridhar's user avatar
  • 73
0 votes
0 answers
70 views

Regex empty string or number [duplicate]

Here is my ng-pattern= "/^[0-9]+(.[0-9][0-9])?$/i" which will allow only any digits and decimal followed by 2 digits, but I want it to match empty string too. How can I do it?
Deeksha's user avatar
  • 21
0 votes
3 answers
686 views

To allow only one numeric value in text box based on regular expression in AngularJs

I'm using ng-pattern : <input type="text" ng-model="price" name="price_field" ng-pattern-restrict="/^[4]*$/" required only-digits> Please let me know what to do that it does not accept any ...
sourav sahu's user avatar
0 votes
2 answers
3k views

Conditional pattern to be used along with required Angular7/8

In my template driven form the textarea is required based on a condtion. I would also like the pattern to be conditional. I tried this syntax based on a question from angular 1.x but it doesn't seem ...
Flash's user avatar
  • 1,014
0 votes
1 answer
136 views

AngularJS:ng-pattern has no effect preventin non numeric userinput in input-field

I'm trying to prevent non numeric userinput in an inputfield: <input ng-model-options="{allowInvalid: false}" ng-pattern="/^[0-9]*$/" class="cell large-3" ng-model="val1" /> ...
user1829716's user avatar
1 vote
0 answers
43 views

How to allow only three numbers before a decimal point and two numbers after it. Is there a regex for this? [duplicate]

Only numbers between 0.00 and 100.00 can be allowed. The number can also be without decimal point. I am trying to use this regex, /^[1-9][0-9]{0,2}(?:,?[0-9]{3}){0,3}(?:\.[0-9]{1,2})?$/ But this ...
user2867091's user avatar
0 votes
1 answer
49 views

Add another regex to an existing one

I have the following 2 pattern : https://codepen.io/anon/pen/OdZaBe /^(?=.*[A-Za-z])(?=.*\d)(?=.*[!#$%\-_=+<>])[A-Za-z\d!#$%\-_=+<>]/; https://codepen.io/anon/pen/ErLOOw /^(?=.*[A-Za-z]...
Crocsx's user avatar
  • 7,766
0 votes
1 answer
54 views

How can ng-pattern be not triggered when the field is pristine?

I use ng-pattern to have validation on one of text inputs. Is there a way to trigger the validation only if the text input has been modified? Or in other words, the validation should not be triggered ...
menteith's user avatar
  • 690
1 vote
1 answer
179 views

Valid regex expressions won't work with AngularJS

I'd like to check if user input is correct for phone numbers in two formats: 01 1234567 (two numbers, a space, seven numbers) +12 123 123 123 123 (plus sign, two numbers, a space, three numbers, a ...
menteith's user avatar
  • 690

15 30 50 per page
1
2 3 4 5
12