Avatar of welcome 123
welcome 123
 asked on

regylar expression help needed for phone numbers

I need a regular exprssion for phone number like the below:

614-466-3333 or 6144663333 or (614)4663333 or 1-614-466-3333 or (614)466-3333

I used the below just for 614-466-3333

  Dim sExpression As String
        Dim blnexpression As Boolean
        sExpression = "^\(?\d{3}\)?\s|-\d{3}-\d{4}$"
        blnexpression = Regex.IsMatch(input, sExpression, RegexOptions.IgnoreCase)
Regular Expressions.NET Programming

Avatar of undefined
Last Comment
Monica P

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
farzanj

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Mazdajai

^(1-)?\(?([0-9]{3})\)?[-.?]?([0-9]{3})[-.?]?([0-9]{4})$

Open in new window

Dale Burrell

Monica P

I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck