...

View Full Version : Validation Expression



EricaStar
11-30-2006, 03:06 PM
I am using a Regular Expression control to check a phone field. The phone
format that I want it ########## (no dashes,spaces,periods,etc.)

Here is my validation Expression: (513|859|812|937) \d{3}\d{4}

I thought I was doing it correctly but this expression does not allow the
four area codes that I want (513,859,812, and 937) Can someone tell me what
the correct expression would be to force the above 4 area codes into the
following format ##########

nikkiH
11-30-2006, 03:17 PM
Did you mean that space to be in there?
It matters.
Also, this can be simplified.

This worked for me.
ValidationExpression="(513|859|812|937)\d{7}"

EricaStar
11-30-2006, 04:28 PM
Thanks Niki.

I had already simplified the end, but I missed the space. It looks like that is what may have happened.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum