P.O. Box Regular Expression Validator - heeeeeelp?

  • 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.

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

Please help?

TIA,
~Gordon
 
Simple Simon said:
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.

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

Please help?

TIA,
~Gordon

There are different syntax-versions around for RE's. The .Net system uses an
advanced
syntax, where most browsers can only understand a simpler version.
The "(?" part is definitely an advanced syntax that most browsers will choke
on.

What exactly do you want to match?

Hans Kesting
 
Hi Hans,
Thanks for responding :) I'd like to check an address box so that it
doesn't contain a P.O. Box as UPS won't ship certain items to a P.O.
Box.

~Gordon
 
Back
Top