Validating PhoneNumber

Posted by Jopito under ASP.NET on 1/10/2014 | Points: 10 | Views : 771 | Status : [Member] | Replies : 3
Hellow.,am validating a phone number in a textbox using the expression below but does not solve out
e.g i need to validate a number in format 254700123456,Can someone help about this?

(\(?\+254\)?\s?(1|2|3|7|8)\d{3}|\(?(01|02|03|07|08)\d{3}\)?)\s?\d{3}\s?\d{3}|(\(?\+44\)?\s?(1|2|3|5|7|8)\d{2}|\(?(01|02|03|05|07|08)\d{2}\)?)\s?\d{3}\s?\d{4}|(\(?\+44\)?\s?(5|9)\d{2}|\(?(05|09)\d{2}\)?)\s?\d{3}\s?\d{3}

Someone with an idea how i can validate number in above format?

Mark as answer if satisfied


Responses

Posted by: Bandi on: 1/10/2014 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Refer
http://stackoverflow.com/questions/18273154/how-to-validate-phone-number-field-to-accept-only-numbers-and-maximum-12-digits
http://forums.asp.net/t/1628021.aspx

Post us back the format of phone number which u want

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

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

Posted by: Jopito on: 1/10/2014 [Member] Starter | Points: 25

Up
0
Down
This will not include the code 254?

Mark as answer if satisfied

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

Posted by: Jopito on: 1/13/2014 [Member] Starter | Points: 25

Up
0
Down
Have tested but no solution yet,it rejects a number when i add it

Mark as answer if satisfied

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

Login to post response