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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:43:30+00:00 2026-06-14T04:43:30+00:00

Wikipedia says that extended regexes dropped support for backreferences, so the basic regex mode

  • 0

Wikipedia says that extended regexes “dropped support for backreferences”, so the “basic” regex mode has to be used to enable those. However, it seems that a number of implementations do support backreferences for extended regexes. For example, with gcc 4.6 on Ubuntu Precise, they are supported. FreeBSD implementations seem to support them only in basic mode.

Boost says (and seems to agree with Wikipedia) that backreferences are not supported for extended regexes, but Boost::Regex adds them as an extension.

Is this just a poorly defined part of the standard which is interpreted differently by every implementation?

  • 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-14T04:43:32+00:00Added an answer on June 14, 2026 at 4:43 am

    As others have already pointed out, it’s quite clear that POSIX EREs do not support back-references.

    The rationale given in the OpenGroup Base Specifications Issue 7 for not adding back-references to EREs is given as:

    It was suggested that, in addition to interval expressions, back-references ( ‘\n’ ) should also be added to EREs. This was rejected by the standard developers as likely to decrease consensus.

    Quoted from: Rationale: Base Definitions: Extended Regular Expressions

    The primary reason for this limitation is to allow POSIX EREs to be converted to a deterministic finite automata (DFA), and indeed the original implementation of EREs in Unix was done as a DFA. The use of a DFA allows guarantees to be made about the performance of the implementation. Pattern matching with (an unbounded number of) back references is an NP-hard problem, and perhaps even an NP-complete problem. Consensus in the POSIX standards committee could never have been reached if back-references were proposed for EREs because that would force all the companies using the original Unix implementation to change their code to a non-deterministic implementation and to drop their performance guarantees, and some of those companies had members on the committee.

    It has also been noted that back-references in REs are not intuitive for either users or implementors, and indeed they’ve caused extreme confusion more often than now. See for example the examples given in RE-Interpretation: The Dark Corners

    NOTE: back-references in REs are not the same as references to sub-patterns in substitution text in tools such as sed.

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

Sidebar

Related Questions

It says on wikipedia and in Stroustrup's FAQ that type long long is at
Wikipedia states that underscores are used by both Android and Microsoft Windows Systems in
Wikipedia says that A piece of code is said to be exception-safe, if run-time
Wikipedia says that locale dictates a set of formatting rules for a specific language/region
Wikipedia says that BlueGriffon can create and edit pages in accordance to HTML 4,
On the Wikipedia page about summation it says that the equivalent operation in Haskell
Wikipedia says that: Non-blocking algorithm ensures that threads competing for a shared resource do
Wikipedia entry says: Each node has a weight equal to the length of its
The Wikipedia article about x86 assembly says that "the IP register cannot be accessed
According to Wikipedia, on the Comparison of programming languages page, it says that F#

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.