function poboxcheck() {// var regexvalue = "(?i)^((?<!P\\.?\\s?O\\.?\\sBox).)+(?<!P\\.?\\s?O\\.?\\sBox)$";//use this rx: var regexvalue = "^(P\\.?\\s?O\\.? Box)";// var re = new RegExp(regexvalue);//and this way to call regexp: var re = new RegExp(regexvalue, "i"); //the "i" modifier makes it case insensitive if ($('SID1_Street').value.match(re)) { alert("You can not use PO Box Address for Physical Addresses. Please use your physical address."); return false;; } else { alert("No match"); }}