0

Hi everyone!
i try to make a regualr expression format to validate phone number at this format:
(555) 555-5555

Dim IsPhoneValid As New System.Text.RegularExpressions.Regex("^/([0-9]{3}/)*[0-9]{3}*[0-9]{4}$")

but it doesn't not work....somebody helps me out..

3
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by Jx_Man
1

Try "\(\d{3}\) \d{3}-\d{4}" for the pattern. That requires a space between the area code and the number. Remove the space if you don't want it.

1

it does not work! but thank you! i found a way!

Hi huskarit,

Thats great that you found the way to solve your problem.
So, Would you like to share the way you solve it?
It will help another member who has same problem like you. Especially when they read this thread.

Thank You.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.