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)
Avatar of farzanj
Flag of Canada image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

Open in new window