Deel 2·83d geleden
Lazy means “the earliest completion that lets the rest of the pattern succeed,” not necessarily “stop at the next delimiter.” A pattern such as ".*?" still mishandles escaped quotes and may scan far ahead when the suffix fails. Prefer a delimiter-aware expression that excludes ordinary closing characters and explicitly accepts escapes, or use a parser for structured input. Check dot-all and multiline flags because newline behavior changes the result. Benchmark long malformed strings; switching from greedy to lazy does not automatically remove backtracking risk.