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

The Archive Base Latest Questions

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

The wikipedia article on PEG states: The fundamental difference between context-free grammars and parsing

  • 0

The wikipedia article on PEG states:

The fundamental difference between
context-free grammars and parsing
expression grammars is that the PEG’s
choice operator is ordered. If the
first alternative succeeds, the second
alternative is ignored. Thus ordered
choice is not commutative, unlike
unordered choice as in context-free
grammars and regular expressions.

But this question has discovered that if the alternatives are substrings of each other; then regexes do not behave according to unordered choice. The wiki is correct for most part but does not take care of this edge condition. Am I correct in my assessment ?

  • 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-21T21:19:25+00:00Added an answer on May 21, 2026 at 9:19 pm

    “regex” != “regular expression”. The latter are pure and simple and of interest only to theoretical computer scientists and symbolic mathematicians.

    “ordered choice” is an implementation option of regex processors.

    You say “if the alternatives are substrings of each other; then regexes do not behave according to unordered choice”.

    A much more correct statement would be “Some regex processors use ordered choice for ALL alternations. This becomes noticeable when an alternative is a prefix of another.”

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

Sidebar

Related Questions

The wikipedia article about Law of Demeter says: The law can be stated simply
The Wikipedia article on Effect system is currently just a short stub and I've
I just read the Wikipedia article on mock objects , but I'm still not
I read the Wikipedia article on scenario testing, but I am sad to say
I want to embed a wikipedia article into a page but I don't want
I try to fetch a Wikipedia article with Python's urllib: f = urllib.urlopen(http://en.wikipedia.org/w/index.php?title=Albert_Einstein&printable=yes) s
I have checked with the wikipedia article , and it seems like it is
I'm trying to learn about catamorphisms and I've read the Wikipedia article and the
I've read the article on Wikipedia on the Duff's device , and I don't
I'm implementing the A* search algorithm from this pseudo on wikipedia's article: function A*(start,goal)

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.