|
-
Apr 27th, 2005, 11:21 PM
#1
Thread Starter
Member
regular expression validator
I have a small problem. I have a form called customer master. I have a textbox control which is supposed to accept the phone number. The phone number can accept hyphen , but not at the beginning. It can begin with + at the beginning. Other than these two it should accept only numbers. I want to know how to validate this at run time not at design time.
can anyone help me with this.
Thanking you,
Sai abhiram Bandhakavi.
-
Apr 28th, 2005, 10:15 AM
#2
Re: regular expression validator
Use this as the ValidationExpression property:
(\+\d{3}-\d{3}-\d{4}|\d{3}-\d{3}-\d{4})
Don't forget to set your ControlToValidate property
-
Apr 28th, 2005, 10:36 AM
#3
Frenzied Member
Re: regular expression validator
This tool might help you out in future - it allows you to test your regular expressions quickly. Also there is a search facility for existing regular expressions.
http://sourceforge.net/projects/regulator/
HTH
DJ
If I have been helpful please rate my post. If I haven't tell me!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|