Regular expressions pcre2 · Quantifiers, groups and alternation

Match as little as possible

Add ? after a quantifier to make it lazy. This matches the shortest text between the quotes.

".*?"

Official Regular expressions pcre2 documentation

More quantifiers, groups and alternation commands

All quantifiers, groups and alternation commands · Regular expressions pcre2 cheatsheet

Was this page helpful?