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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:23:34+00:00 2026-06-17T16:23:34+00:00

I am trying to find a regular expression for mobile phones that gives me

  • 0

I am trying to find a regular expression for mobile phones that gives me 07550440002 or +4475504400003 up to 20 characters, i.e. I want a regular expression that may + or may not and then a whole number. I have ^(\+?[0-9])$ but I keep on getting the error message unexpected quantifier.

This happens when I try and run the follwowing code –

if (!$(textBox).val().match(RestrictionRegularExpressions.MOBILEPHONE)) {

Where RestrictionRegularExpressions.MOBILEPHONE is set the above reg expression

I don’t think it likes the \+.

This is using JQuery/Javascript

Any help would be greatly appreciated.

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-17T16:23:35+00:00Added an answer on June 17, 2026 at 4:23 pm

    I believe that the given regular expression does not work because the backslash needs to be escaped as well. Using a double backslash should do the trick.

    The following regular expression worked for me:

    ^\\+?[0-9]{0,20}$
    

    Which I tested using this page on W3Schools web-page: http://www.w3schools.com/js/tryit.asp?filename=tryjs_regexp_test. It accepts 0 to 20 numbers prefixed by an optional ‘+’ sign.

    Hope that helps

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

Sidebar

Related Questions

I'm trying to find a regular expression that would allow me replace the SRC
I'm trying to find a regular expression that will let me extract JUST the
I'm trying to find a single regular expression that I can use to parse
Im trying to find a regular expression that matches this kind of URL: http://sub.domain.com/selector/F/13/K/100546/sampletext/654654/K/sampletext_sampletext.html
I am trying to create a JavaScript regular expression that can find a keyword
I've been trying for a while to find a regular expression that I need.
I'm trying to find a regular expression for a URL that will be compliant
I'm trying to use a regular expression to find all substrings that start with
Im trying to make a regular expression in python that allows me to find
I'm trying to find a regular expression that matches a word in a string

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.