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

  • Home
  • SEARCH
  • 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 8989277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:13:04+00:00 2026-06-15T22:13:04+00:00

What would be a proper regular expression for JavaScript to cover cell phone number

  • 0

What would be a proper regular expression for JavaScript to cover cell phone number like the following?

000-00-0000
  • 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-15T22:13:05+00:00Added an answer on June 15, 2026 at 10:13 pm

    The \d is shorthand for a digit so I’d go with something like this:

    var pattern = /^\d{3}-\d{2}-\d{4}$/;
    if(orig_input.match(pattern)) {
        //do stuff...
    }
    

    However, and this is because I have no idea how phone-numbers look in your country id probably also go with something else in the last part since the length of that probably can differ so lets say that the minimum is 4 digits and the maximum is six then I’d do something like this.

    var pattern = /^\d{3}-\d{2}-\d{4,6}$/;
    if(orig_input.match(pattern)) {
        //do stuff...
    }
    

    Notice the last part in the regular expression \d{4,6}.

    Also this isn’t a very tricky question so listen to the community (the comments) and try to google stuff like this in the future, you’ll always learn more if you figure stuff out by yourself.

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

Sidebar

Related Questions

This yields proper results, but I would like to have the resulting row in
I can't seem to figure out the proper regular expression for extracting just specific
I would like to know the proper way to handle a new connection from
When the user has javascript disabled, I would like to make the ajax.beginform not
Would this be a proper way to dispose of a BackGroundWorker? I'm not sure
How would one follow the proper steps in order to license a package under
I would appreciate some help on creating the proper SQL to retrieve only one
Any idea what the proper containing markup would be to indicate a transcript for
Would like to parse IPv4 address from exit-addresses . Format of the file: ExitNode
The question is too simple, but still appreciate the short answer. I would like

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.