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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:24:54+00:00 2026-05-15T22:24:54+00:00

using http://www.regular-expressions.info/javascriptexample.html I tested the following regex ^\\{1}([0-9])+ this is designed to match a

  • 0

using http://www.regular-expressions.info/javascriptexample.html I tested the following regex

 ^\\{1}([0-9])+ 

this is designed to match a backslash and then a number.

It works there

If I then try this directly in code

var reg = /^\\{1}([0-9])+/;
reg.exec("/123")

I get no matches!

What am I doing wrong?

  • 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-05-15T22:24:54+00:00Added an answer on May 15, 2026 at 10:24 pm

    You need to escape the backslash in your string:

    "\\123"
    

    Also, for various implementation bugs, you may want to set reg.lastIndex = 0;.
    In addition, {1} is completely redundant, you can simplify your regex to /^\\(\d)+/.
    One last note: (\d)+ will only capture the last digit, you may want (\d+).

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

Sidebar

Related Questions

I found this useful article on using Active Patterns with Regular Expressions: http://www.markhneedham.com/blog/2009/05/10/f-regular-expressionsactive-patterns/ The
I'm using this ( http://www.j-download.com/demo/demo-j-dcontact.html ) form on my website. It works great but
I am using this regular expression to validate youtube urls. ^http:\/\/(?:www\.)?youtube.com\/watch\?(?=.*v=\w+)(?:\S+)?$ it works great.
Im looking at this implementation of DCT using cuda: http://www.cse.nd.edu/courses/cse60881/www/source_code/dct8x8/dct8x8_kernel1.cu The part in question
Using this tutorial: http://www.c-sharpcorner.com/uploadfile/UrmimalaPal/creating-a-windows-phone-7-application-consuming-data-using-a-wcf-service/ I have created sample/hello world application on the windows phone
Yes, yes, I've weighed using an xml parser instead of regular expressions, but this
According to http://www.codingforums.com/archive/index.php/t-98569.html , the date validation could be done using the javascript's date
Hi I'm looking a regular expression that will change this: [check out this URL!](http://www.reallycoolURL.com)
Extracting data between HTML tags using regular expression I have this example which successfully,
I'm having problems using regular expression to match http links. I have a pattern

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.