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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T03:19:38+00:00 2026-05-21T03:19:38+00:00

I know what * is and what ? is. However, I don’t understand what

  • 0

I know what * is and what ? is.

However, I don’t understand what *? is. I know it’s used to make the “greedy” * operator a lazy one, but still, how does that read if * is zero or more times and ? is one or one time.

Thank you.

EDIT:
I underline the fact that I know what *, ?, greedy and lazy are.

  • 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-21T03:19:39+00:00Added an answer on May 21, 2026 at 3:19 am

    This is a trick that has been used to extend regexp syntax without adding more special characters. Of course saying “zero or one” after “zero or more” has no meaning… so the combination *? should be read as a single token meaning “zero or more – not greedy”. In a similar way +? should be read as a single token meaning “one or more – not greedy”.

    Greedyness never changes what strings are matched and what are not matched, but it may change what is the match found. For example group 1 of (AB*?)B+ matches A in ABBBBB, but group 1 of (AB*)B+ matches ABBBB in the same string.

    The question mark in “strange places” has been used also in other special combinations that are available in several regexp engines, for example:

    (?=...)     zero-width positive lookahead assertion
    (?!...)     zero-width negative lookahead assertion
    (?:...)     non-tagging group
    

    as you see they all start with (? where clearly the question mark couldn’t mean “zero or one” (we’re at the beginning of an expression, zero or one of what?).

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

Sidebar

Related Questions

I know that the keyword assert exists in java. However I don't remember seeing
https://i.stack.imgur.com/2KxdM.png I have this segmented control that I made, however I don't know how
I know in Scrollview you can access scrollView.getMaxScrollAmount however I don't seem to understand
I know PHP scripts don't actually compile until they are run. However, say I
I am getting the following error on my site, however, i don't know what
I know that PHP4 is dead, however there are about two dozen or so
I know that there is no return type of the constructors in C++ However,
I know that the MsNLB can be configured to user mulitcast with IGMP. However,
Today I notice outline propery in CSS. However I don't know why it is
If you use an AbsoluteLayout (I know that it is deprecated, but it was

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.