jQuery NIC validate
you can use standard javaScript to test the Regex expression:
var idToTest = '12345-1234567-1',
myRegExp = new RegExp(/\d{5}-\d{7}-\d/);
if(myRegExp.test(idToTest)) {
//if true
}
else {
//if false
}
Try this:
var cnic_no = '12345-1234567-9',
var cnic_no_regex = /^[0-9+]{5}-[0-9+]{7}-[0-9]{1}$/;
if(cnic_no_regex.test(cnic_no))
{
alert('Right');
}
else
{
alert('Wrong');
}
JsFiddle: https://jsfiddle.net/k81w2x77/1/
JsFiddle: https://jsfiddle.net/fokq2woq/10/