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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T01:17:44+00:00 2026-06-19T01:17:44+00:00

I was browsing through the internet to find a proper javascript regular expression for

  • 0

I was browsing through the internet to find a proper javascript regular expression for phone numbers but the ones I find are not the ones I need.

The acceptable phone number type for my case would have to match the following rules:

  • May start with + or 0-9
  • all rest string is allowed to have only 0-9, - and space (preferably only 1 space between numbers)

I tried so far this: /^\+[\-\d\s]/ but I am not getting the proper result. I’ve tried to read some tutorials but I am very new to this and it seems I am missing something.

An acceptable phone number for example would be: +30 6995 4488551 (spaces allowed) or 0030 6995 4488551 etc.

Any help would be much appreciated! 🙂

  • 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-19T01:17:45+00:00Added an answer on June 19, 2026 at 1:17 am

    Your regex matches anything that starts with a + followed by a single -, digit or whitespace character. So you will match for example:

    • +4qwertzuiopasdfghjkl
    • +-asdfasdfasdfasdf

    I suggest you to look at the examples and tutorials on http://www.regular-expressions.info/. As for your telephone numbers a better regex would be:

    /^\+?[\d -]+$/
    

    This would match all valid numbers but also invalid constructions like +--------- or simply + with a trailing space. If you want to be really close to denying a lot of invalid combinations I would suggest you read this, but as you can see the regexes get messy.

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

Sidebar

Related Questions

I've been browsing through the web but haven't been able to find any concrete
Question says it all. I tried browsing through the latest tag but could not
Browsing through http://msdn.microsoft.com/en-us/library/windows/apps/br230232.aspx I could not find anywhere that said Windows 8 Apps support
I tried Googling and browsing through PHP docs but I can't find a limit
I have been browsing through Google for various explanations but I STILL couldn't figure
Browsing the Internet, I found the new Ample SDK JavaScript framework. From their about
When browsing through the internet for the last few years, I'm seeing more and
I'm browsing through OpenJDK sources and cannot find the place where optimized code is
I've been browsing through the documentation, but I can't seem to figure out a
I'M browsing through the whole stackoverflow forum but I'm quite unsure if my marshalling

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.