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

Recommended Answers

All 3 Replies

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.

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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.