Feature: Alternatives
Home | Features | Improve this section
An Alternative represents two or more branches in a pattern. If first branch of a pattern fails to match, each alternative is attempted from left to right until a match is found.
Syntax
NOTE: The following syntax is an example based on some of the supported engines. For specific engine support, see Engines.
…|…
— Matches the pattern to the left of the|
. If that fails, matches the pattern to the right of|
.
Engines
Engine | Supported |
---|---|
Perl | ✔ |
PCRE | ✔ |
Boost.Regex | ✔ |
.NET | ✔ |
Oniguruma | ✔ |
Hyperscan | ✔ |
ICU | ✔ |
Glib/GRegex | ✔ |
ECMAScript | ✔ |