The lack of lazy matching in regular expressions makes certain regular languages impossible to parse. https://stackoverflow.com/a/39752929/8890015 but that only matches one occurrence. TRE is a minimal library, 64KB in Debian amd64, that has the O(n) guarantee that all regular expressions engines SHOULD have, and supports lazy matching. I was told once that libc++ used TRE, but I can't find proof right now... I am talking about: .*? https://github.com/laurikari/tre/ An example of something impossible to parse: Foo: bar Diz: harf Two: newlines Requires: lazymatches When: number of keys Is: variable You: can't parse this Without: lazy matches