nonplussed
nonplussed

Reputation: 21

Double plusses in regex

I have seen several regular expressions that have two plusses in a row. What exactly does this mean? One or more of one or more of the pattern. If the pattern matches in the first place, why would the second match be necessary?

Examples:

[a-zA-Z0-9_]++
[^/.,;?]++

Upvotes: 2

Views: 158

Answers (1)

Bart Kiers
Bart Kiers

Reputation: 170148

They're called possessive quantifiers.

Upvotes: 5

Related Questions