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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:30:19+00:00 2026-06-08T18:30:19+00:00

I am trying to become better at regular expressions. I am having a hard

  • 0

I am trying to become better at regular expressions. I am having a hard time trying to understand what does (?> expression ) means. Where can I find more info on non-backtacking subexpressoins? The description of THIS link says:

Greedy subexpression, also known as a non-backtracking subexpression.
This is matched only once and then does not participate in
backtracking.

this other link: http://msdn.microsoft.com/en-us/library/bs2twtah(v=vs.71).aspx has also a definition of non-backtracking subexpression but I still am having a hard time understanding what it means plus I cannot think of an example where I will use (?>exp)

  • 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-08T18:30:20+00:00Added an answer on June 8, 2026 at 6:30 pm

    As always, regular-expressions.info is a good place to start.

    Use an atomic group if you want to make sure that whatever has once been matched will stay part of the match.

    For example, to match a number of “words” that may or may not be separated by spaces, then followed by a colon, a user tried the regex:

    (?:[A-Za-z0-9_.&,-]+\s*)+:
    

    When there was a match, everything was fine. But when there wasn’t, his PC would become non-responsive with 100% CPU load because of catastrophic backtracking because the regex engine would vainly try to find a matching combination of words that would allow the following colon to match. Which was of course impossible.

    By using an atomic group, this could have been prevented:

    (?>[A-Za-z0-9_.&,-]+\s*)+:
    

    Now whatever has been matched stays matched – no backtracking and therefore fast failing times.

    Another good example I recently came across:

    If you want to match all numbers that are not followed by an ASCII letter, you might want to use the regex \d+(?![A-Za-z]). However, this will fail with inputs like 123a because the regex engine will happily return the match 12 by backtracking until the following character is no longer a letter. If you use (?>\d+)(?![A-Za-z]), this won’t happen. (Of course, \d+(?![\dA-Za-z]) would also work)

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

Sidebar

Related Questions

I'm trying to divorce myself from my mouse in order to become more product
I'm trying to learn EventMachine (and become a better, asynchronous programmer). I thought I
I'm trying to do remove JavaScript comments via a regular expression in C# and
I'm working with recursion trying to become better at with it. My current activity
I'm trying to solve an exercise in order to become more familiar with prolog.
I am trying to become better with JavaScript and I have done a great
I'm trying to combine the following expressions into a single expression: item => item.sub,
I'm trying to become a better javascript developer by making use of established design
Alright, I'm trying to figure out why I can't understand how to do this
I am trying to add Become-a-Fan button to my 2008 asp.net website (vb) Here

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.