P.O. Box Regular Expression Validator - heeeeeelp?

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
 
H

Hans Kesting

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
 
S

Simple Simon

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top