Link to home
Start Free TrialLog in
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)
ASKER CERTIFIED SOLUTION
Avatar of farzanj
farzanj
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
^(1-)?\(?([0-9]{3})\)?[-.?]?([0-9]{3})[-.?]?([0-9]{4})$

Open in new window