steveosoule
10/25/2014 - 12:04 AM

JavaScript PO Box Test

JavaScript PO Box Test

var pattern = /^box[^a-z]|(p[-. ]?o.?[- ]?|post office )b(.|ox)/i,
    value = $('input.po-box').val();

if( pattern.test( value ) ){
	// this is a PO Box
}