Feature: Possessive Quantifiers
Home | Features | Improve this section
Possessive Quantifiers are like greedy (i.e., regular) quantifiers, except that backtracking is not performed.
Syntax
NOTE: The following syntax is an example based on some of the supported engines. For specific engine support, see Engines.
*+
— Match zero or more characters without backtracking.++
— Match one or more characters without backtracking.?+
— Match zero or one characters without backtracking.{n,}+
— Where n is an integer. Matches the preceding Atom at-least n times without backtracking.{n,m}+
— Where n and m are integers, and m >= n. Matches the preceding Atom at-least n times and at-most m times without backtracking.
Engines
Engine | Supported |
---|---|
Perl | ✔ |
PCRE | ✔ |
Boost.Regex | ✔ |
.NET | ❌ |
Oniguruma | ✔ |
Hyperscan | ❌ |
ICU | ✔ |
Glib/GRegex | ✔ |
ECMAScript | ❌ |