In PCRE, does this pattern match "aaa"?
/^a++a$/ // input: "aaa"
- No,
a++never gives back - Yes,
a++gives back one a - Yes,
++means two or more - No,
++is a syntax error
The possessive
Play Regex ▸
a++ eats all three a's and refuses to backtrack, leaving nothing for the final a.