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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T23:34:23+00:00 2026-06-07T23:34:23+00:00

I am trying to capture a value out of a string. The string’s format

  • 0

I am trying to capture a value out of a string. The string’s format should be

01+XXXX

and I want to capture XXXX using a regular expression. This is what I came up with –

01+\\s*(?<1>[.0-9]*)

But that won’t work. What DOES work is –

01+\\s*(?<1>[+.0-9]*)

The only difference is adding the + into the character class. My main question is – why does the second expression work and the first expression doesn’t? In the first one, I look for 01+ and the rest of it should go to [.0-9]. It seems to me that the second one wants to read + twice – is that not what its doing? I am pretty new to regular expressions so I feel like I might be missing something small.

On this site http://www.codeproject.com/Articles/9099/The-30-Minute-Regex-Tutorial it says that + is used for “Repeat one or more times”. So is it trying to read 01+ more than once?

  • 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-07T23:34:26+00:00Added an answer on June 7, 2026 at 11:34 pm

    It’s reading the 1 one or more times. That is, the regex 01+ matches 01 or 011 or 0111 etc.

    But it doesn’t match the +. If you want to match a literal +, write 01\+ or 01[+] for the regex.

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

Sidebar

Related Questions

I'm using SharpPcap to capture packets. I'm trying to get Traffic Class value and
Hey all, I'm using this colorpicker ( http://www.eyecon.ro/colorpicker ) and am trying to capture
Regular expressions allow us to specify some format a string should match, and then
I'm having some trouble trying to develop a regular expression which will pick out
I trying to capture packets using SharpPcap library. I'm able to return the packets
I'm trying to capture dvdauthor's output to a file. So far i found this
I'm trying to work out what's going on with this code. I have two
I can't seem to figure out how to do this. I am trying to
WebDriver->I am trying to capture the 'date' selected from a UI-Calender. I want to
I'm using dojo and dijit and have an inlineEditBox widget. I'm trying to capture

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.