I have a regular expression please check the corresponding regexr link http://regexr.com/3brm6 and it is working fine as per my requirement. While using the same regular expression over javascript it is not working. below is the code
function validateAddresscode(Addr) {
var addrRegExp = /^([pP]{1,1}[\.]?[oO]{1,1}[\.]?)$/igm;
if (addrRegExp.test(Addr)) {
return true;
} else {
return false;
}
}
Please help me out thanks in advance.