P.O. Box Validation -- Hans?...Steve(Guru)?

  • Thread starter Thread starter Simple Simon
  • Start date Start date
S

Simple Simon

Hi,
I need some help getting this P.O. Box regular expression to work, or
a new expression entirely. I got this one from a Google Groups
search. It seems to work at: http://regexlib.com/ but not at runtime.

I need to check if a P.O. Box exists in an address text box...UPS
won't ship some items to a P.O. Box.

ValidationExpression="(?i)^((?<!P\.?\s?O\.?\sBox).)+(?<!P\.?\s?O\.?\sBox)$"

Please help?

TIA,
~Gordon
 
Actually, I think you will find that UPS won't ship _ANYTHING_ to a P.O. Box

Keep in mind also, as you suggest this is valid:

P O Box 123

but so are these:

P.O. Box 123
PO Box 123
P O Box 123
Box 123
#123

(I'm sure I missed some combinations)

You will have to check for each one as may vary from person to person.

In addition UPS may ship to:

132 Main Street
Box 123
Anytown, USA

as it may be a Mailbox Etc. (now UPS Store) store

Just some extra food for thought


Good luck
Brian W
 
Back
Top