Is this an incorrect description of alternatives in regular expressions?

A PEG wikipedia article says:

The main difference between context-free grammar and parsing grammar expressions is that PEG is the operator of choice. If the first alternative succeeds, the second alternative is ignored. Thus, choice is not commutative, as opposed to unordered choice, as in context-free grammar and regular expressions.

But this question found that if alternatives are substrings of each other; then regular expressions do not behave according to unordered choice. The wiki version is true for most, but does not care about this boundary condition. Am I correcting my assessment?

+3
source share
1 answer

"regex"! = "regular expression". The latter are pure and simple and interesting only to theoretical computer scientists and symbolic mathematicians.

"ordered selection" is an implementation option for regex processors.

You say "if alternatives are substrings of each other, then regular expressions don't behave by random order."

A much more correct statement would be: "Some regular expression processors use an ordered choice for ALL alternations, which becomes noticeable if the alternative is a prefix of another."

+1
source

All Articles