Regex Cheat Sheet/Possessive class quantifier

Consume as much as possible without backtracking.

Section: Performance and Backtracking

Possessive class quantifier

regex
regex
[A-Z]++
Explanation

Can reduce backtracking in ambiguous patterns.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Performance and Backtracking
Atomic group
Prevent backtracking into a grouped subpattern.
OpenIn sheetregexsame section
Avoid nested greedy stars
Example of a risky pattern to rewrite.
OpenIn sheetregexsame section
Constrained tag content
Use explicit stop characters instead of dot-star where possible.
OpenIn sheetregexsame section
Possessive quantifier
Repeat without backtracking.
OpenIn sheetregex2 tag match
Start of string
Match only at the beginning of the input.
Digit shorthand
Match one ASCII digit character.