Regex Cheat Sheet/Possessive quantifier

Repeat without backtracking.

Section: Quantifiers

Possessive quantifier

regex
regex
\d++
Explanation

Supported in PCRE/Java-style engines; useful to reduce catastrophic backtracking.

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 Quantifiers
Zero or more
Repeat the previous token any number of times.
OpenIn sheetregexsame section
One or more
Repeat the previous token at least once.
OpenIn sheetregexsame section
Zero or one
Make the previous token optional.
OpenIn sheetregexsame section
Exact repetition
Match an exact number of repetitions.
OpenIn sheetregexsame section
Range repetition
Match between a minimum and maximum number of repetitions.
OpenIn sheetregexsame section
Open-ended repetition
Match at least a minimum number of repetitions.
OpenIn sheetregexsame section