Quantifiers and Backtracking: Greedy, Lazy, Possessive and Atomic Groups
A greedy quantifier first takes all it can and gives characters back one by one when the rest of the pattern fails; a lazy one takes little and adds one at a time, yet both spend steps searching for the delimiter, and the correct and fastest option is usually a negated class. We compare greedy, lazy, possessive and atomic groups with PCRE2 step counts and extract endpoint, status and duration from Bookstore's access log with .NET, JavaScript and sed.
15 Nov 2026
·
12 min
·
6