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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:13:39+00:00 2026-05-12T05:13:39+00:00

I am reading the PCRE doc, and it refers to possessive quantifiers , but

  • 0

I am reading the PCRE doc, and it refers to possessive quantifiers, but does not explicitly or specifically define them. I know what a greedy quantifier is, and I know what a lazy quantifer is. But possessive?

The PCRE man page seems to be cheating when it uses the term without defining it. The man page specifically states that the term possessive quantifiers was first defined in Friedl’s book. Well, that’s great, but I don’t have Friedl’s book, and in reading the man page, between the lines, I cannot figure out what distinguishes possessive quantifiers from greedy ones.

  • ? = zero or one, greedy
  • ?? = zero or one, lazy
  • ?+ = zero or one, possessive
  • ‘+’ = one or more, greedy
  • +? = one or more, lazy
  • ++ = one or more, possessive
  • 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-12T05:13:39+00:00Added an answer on May 12, 2026 at 5:13 am

    Perhaps the best place to start is Regex Tutorial – Possessive Quantifiers:

    When discussing the repetition
    operators or quantifiers, I explained
    the difference between greedy and lazy
    repetition. Greediness and laziness
    determine the order in which the regex
    engine tries the possible permutations
    of the regex pattern. A greedy
    quantifier will first try to repeat
    the token as many times as possible,
    and gradually give up matches as the
    engine backtracks to find an overall
    match. A lazy quantifier will first
    repeat the token as few times as
    required, and gradually expand the
    match as the engine backtracks through
    the regex to find an overall match.


    Possessive quantifiers are a way to prevent the regex engine from
    trying all permutations. This is primarily useful for performance
    reasons. You can also use possessive quantifiers to eliminate certain
    matches.

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

Sidebar

Related Questions

Reading Chomsky hierarchy ... ... I know regexp can't parse type-2 grammars (context-free grammars),
Reading the doc file with the use of Apache POI & docx4j. i had
Reading the bottom of the documentation, specifically: You can still retrieve properties of deleted
Reading this: http://guides.rubyonrails.org/routing.html#adding-more-restful-actions What does it mean to add a 'member route'? or do
Reading this old but classic document Writing High-Performance Managed Applications - A Primer ,
Reading this zero copy article , Does Zero-copy exist in Windows OS (server 2003,
Reading about the Dispose pattern , I see the documentation repeatedly refer to cleaning
Reading some questions here on SO about conversion operators and constructors got me thinking
Reading among the list of possibilities of the Java ME platform, its possible for
reading the documentation for java org.w3c.dom.ls it seems as a Element only can be

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.