erikrose / parsimonious

The fastest pure-Python PEG parser I can muster
MIT License
1.79k stars 126 forks source link

[request] support lazy and possessive quantifiers #244

Open alexchandel opened 2 months ago

alexchandel commented 2 months ago

Extended regular expression engines include "lazy" and "possessive" versions of the quantifiers as alternatives to the default "greedy" ones.

Lazy quantifiers are useful in many cases, and avoid the need for negative lookaheads. Possessive quantifiers provide performance boosts by preventing backtracking, and also allow some strict syntaxes to be specified more concisely.