Regular expression to validate string

Posted by Sahoo under ASP.NET on 2/13/2013 | Points: 10 | Views : 1551 | Status : [Member] | Replies : 3
Hi ALL ,

I want a regular expression that will accept a phone no with digit(0-9) along with "-", "+", "(", ")", "." , "," and space .

Thanks In Advance




Responses

Posted by: Santhi on: 2/13/2013 [Member] Starter | Points: 25

Up
0
Down
Hi

[0-9 ,-.+()]
You can test this expression in the following link:
http://gskinner.com/RegExr/

Thanks & Regards,
V. Santhi

Thanks & Regards,
Santhi .V

Sahoo, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: aswinialuri-19361 on: 2/14/2013 [Member] Starter | Points: 25

Up
0
Down
HII

better to use this
validation Expression=" V^[01]?[- .]?(\([2-9]\d{2}\)|[2-9]\d{2})[- .]?\d{3}[- .]?\d{4}$"


Thanks & Regards




Mark as Answer if it helps you
Thanks&Regards
Aswini Aluri

Sahoo, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sahoo on: 2/14/2013 [Member] Starter | Points: 25

Up
0
Down
Thanks all for help.

I donot need any specific format for like XXX-XXX-XXXX OR XXXX-XXXXXX. Just it will be a string of any combination above characters.

Sahoo, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response