Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
leon's p.o. box detection regex
// leon's p.o. box detection regex
// for better results, trim and compress whitespace first
var pobox_re = /^box[^a-z]|(p[-. ]?o.?[- ]?|post office )b(.|ox)/i,
arr = [
"po box",
"p.o. box",
"p.o box",
"p-o box",
"post office box",
"P.O. Box",
"PO Box",
"PO box",
"box 122",
for (var i in arr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment