Feature: Lookbehind
Home | Features | Improve this section
A Lookbehind is a zero-width assertion that matches if the provided pattern would match the characters to the left of the current position.
Syntax
NOTE: The following syntax is an example based on some of the supported engines. For specific engine support, see Engines.
(?<=…)— Positive Lookbehind. Matches if the provided pattern would match the preceding characters, but does not advance the current position. The pattern must have a fixed length (unbounded quantifiers are not permitted).(?<!…)— Negative Lookbehind. Matches if the provided pattern would not match the preceding characters, but does not advance the current position. The pattern must have a fixed length (unbounded quantifiers are not permitted).
Engines
| Engine | Supported |
|---|---|
| Perl | ✔ |
| PCRE | ✔ |
| Boost.Regex | ✔ |
| .NET | ✔ |
| Oniguruma | ✔ |
| Hyperscan | ❌ |
| ICU | ✔ |
| Glib/GRegex | ✔ |
| ECMAScript | ✔ |