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