Feature: Non-Backtracking Expressions
Home | Features | Improve this section
A Non-Backtracking Expression is matched independent of neighboring patterns, and will not backtrack in the event of a failed match. This is often used to improve performance.
Syntax
NOTE: The following syntax is an example based on some of the supported engines. For specific engine support, see Engines.
(?>…)
— Matches the provided pattern, but no backtracking is performed if the match fails.
Engines
Engine | Supported |
---|---|
Perl | ✔ |
PCRE | ✔ |
Boost.Regex | ✔ |
.NET | ✔ |
Oniguruma | ✔ |
Hyperscan | ❌ |
ICU | ✔ |
Glib/GRegex | ✔ |
ECMAScript | ❌ |