I have a function from another thread that helps to detect POBoxes, but it doesn't quite work as intended.
function isPOBox(v){
var r = new RegExp('[PDO.]*\\s?B(ox)?.*\\d+', 'i');
return v.match(r);
}
If I have the value 'Lvl 1 TowerB, 999 C G Road'
it incorrectly picks it up as a PObox.
As you can see, there's no P
in the above.
How would I go about editing the regex to be more specific around POBoxes?
I have set up a demo Fiddle here: http://jsfiddle.net/xCQwM/