Looking to validate PO Box but wanted to know if such validation existed. I have the Address field split into Address 1 and Address 2 (Where such PO, Apt, Suite info would go)>
As of now with your regex, the 'O' in 'OFFICE' is required. Try ^\s*((P(OST)?.?\s*(O(FF(ICE)?))?.?\s+(B(IN|OX))?)|B(IN|OX))
instead (grouping the 'O' in a conditional match).
EDIT: That should be /^\s*((P(OST)?.?\s*(O(FF(ICE)?)?)?.?\s+(B(IN|OX))?)|B(IN|OX))/i
instead. BTW, http://rubular.com/ is a pretty good regular expression testing engine. Always nice to know of new tools :)