Regex For PO BOX Address

If a PO Box is present at the address, the code below returns true.

poboxcheck: function (add) {
   var re = /^\b(P(ost|ostal)?([ \.]*(O|0)(ffice)?)?([ \.]*Box)?[ 0-9]*[^[a-z ]*|(?:^|\W)box(?:$|\W)?[ 0-9]*[^[a-z ]]*)$/ig
   var result = re.test(add)
   return result
}

Leave a comment

Your email address will not be published. Required fields are marked *