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 did the validation for IP address and it worked fine like shown below:
<label class="input">
<input type="text"
name="textreadOnlyInfoWiFiIPAddress"
ng-model="readOnlyInfo.WiFiIPAddress"
ng-value="readOnlyInfo.WiFiIPAddress"
ng-pattern='/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/'
ng-model-options="{ updateOn: 'blur' }"
placeholder='xxx.xxx.xxx.xxx'>
</label>
Now I am trying to implement the same method for Mac addresses:
<input type="text"
name="textreadOnlyInfoWifiMACAddress"
ng-model="readOnlyInfo.WifiMACAddress"
ng-value="readOnlyInfo.WifiMACAddress"
ng-pattern='/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/'
ng-model-options="{ updateOn: 'blur' }"
placeholder='xx:xx:xx:xx:xx:xx'>
</label>
and it is not working as expected, How ng-pattern for mac address in this case?