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 7853893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:50:40+00:00 2026-06-02T19:50:40+00:00

I want to do a regex pattren in JavaScript that will allow a string

  • 0

I want to do a regex pattren in JavaScript that will allow a string only with numbers and this signs: ()+ and a space. In a length of 5-16 chars.

Please Note: the order of the chars in the string is not important.

What is the right pattren for this?

Thanks

  • 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-02T19:50:42+00:00Added an answer on June 2, 2026 at 7:50 pm

    How about this:

    /^[0-9 ()+]{5,16}$/
    

    It’s quite easy to construct it by yourself. )
    First, as you impose strict limits, you should check the whole string, so regex should be wrapped into /^...$/.

    Second, if you only need some specific characters, you should use character class: write all them down into […] form. In your case you can shortcut: replace /^[0123456789 ()+]$/ with just /^[0-9 ()+]$/.

    Finally, state some quantitative limits with {$min, $max} form: in your case that would be {5,16}. Mix this into what you got so far – and voila! You solved the task. )

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

Sidebar

Related Questions

I want a regex pattern which will allow me any chars, but it will
I want a regex pattern to check that the string doesn't contain any digits
I want to stop out all characters that do NOT match this regex pattern:
The following JavaScript code returns false if the string contains only numbers or characters
I want a regex pattern to find all the words of this format [xyzblab23la].
Heres my regex pattern: [A-Z][a-z]?-?([A-Z][a-z]?)? I want this regex to match the following: A
I want a regex expression which only match extensionless url. In otherwords if an
I want to access RegEx results after I am done moving files with this
I want to use a regex to find a particular string in my sample,
I want a regex pattern to allow a mailto: link to have multiple email

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.