I am trying to validate IP Address in the text box with ng-pattern
CODE:
<input name="machinestodiscover" type="text" ng-model="machinestodiscover" ng-minlength="7" ng-maxlength="15" ng-pattern="/\b([0-9]{1,3})[.]([0-9]{1,3})[.]([0-9]{1,3})[.]([0-9]{1,3})\b/" required>
<span ng-show="conditionForm.machinestodiscover.$error.required" class="help-block" style="display:inline;">*Machines To discover Required</span>
<span ng-show="conditionForm.machinestodiscover.$error.pattern" class="help-block" style="display:inline;">*IP Pattern Wrong.</span>
The problem I am facing is that it is even accepting value as 1.1.1.1.1.1.1.
where as I checked the expression in http://regexr.com/
Screenshots:
What is wrong in my regex/ng-pattern