Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8861471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:29:58+00:00 2026-06-14T15:29:58+00:00

I am not very experienced with regex and I need to validate phone numbers

  • 0

I am not very experienced with regex and I need to validate phone numbers using javascript.
I have a textbox which need to be allowed to accept multiple phone numbers with a delimiter of ';' and the characters that can be allowed for the phone numbers are

  1. Numbers
  2. ‘+’
  3. ‘-‘

Could someone help me on how I can acheive this using javascript and regex/ regular expressions?

Example:

+91-9743574891;+1-570-456-2233;+66-12324576

I tried the following:

^[0-9-+;]+$

Am not sure if this is correct.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T15:29:59+00:00Added an answer on June 14, 2026 at 3:29 pm

    You have placed - in wrong place so, your regex is not working.

    Try this(your RegEx, but slightly modified):

    ^[0-9+;-]+$
    

    or

    ^[-0-9+;]+$
    

    To include a hyphen within a character class then you must do one of the following:

    1. escape the hyphen and use \-,
    2. place hyphen either at the beginning or at the end of the character class.

    As the hyphen is used for specifying a range of characters. So, regex engine understands [0-9-+;]+ match any of the characters between 0 to 9, 9 to +(all characters having decimal code-point 57[char 9] to 43[char +] and it fails) and ;.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not very experienced in JSP. I have an application, which uses the Spring
I'm not very experienced programmer in C++ and I have a problem which I
I'm not very experienced with JavaScript, but this code was similar to what I
I am not very experienced with PHP. I have a site I'm maintaining that
I am not very experienced with rails, but I have used it for several
I'm not very experienced at JS (PHP is my strong side) so I need
I am not very experienced with VB.NET but I have to build an application
I will need a code example; I'm not very experienced. I need a ListView
I'm not very experienced in C++, and when I have to work with another
I'm not very experienced in cpp (used to work in python). I have the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.