RegexDialectFeatures Enum

The optional constructs a RegexDialect supports.

[Flags]
public enum RegexDialectFeatures : long

Remarks

A feature records a difference within a grammar family. Differences between families are handled by RegexDialectFamily, which selects the parser.

A construct the dialect does not have is not parsed as that construct. Where there is an ordinary reading it is used instead -- \A is the letter A where there is no such anchor -- and where there is not, the construct is reported as invalid.

Fields

NameValueDescription
None0
ExtendedGroupSyntax1The (?…) family of headers exists at all. POSIX has none of them, so a ? after ( is an ordinary quantifier with nothing to repeat rather than the start of a header.
NonCapturingGroups2Non-capturing groups, (?:…).
NamedGroups4Named groups in any spelling.
AngleNamedGroups8Angle-bracket named groups, (?<name>…).
QuoteNamedGroups16Single-quoted named groups, (?'name'…).
PythonNamedGroups32Python-style named groups, (?P<name>…).
BalancingGroups64Balancing groups, (?<current-previous>…).
AtomicGroups128Atomic groups, (?>…).
BranchReset256Branch reset groups, (?|…).
Conditionals512Conditional alternations, (?(1)yes|no).
CommentGroups1024Comment groups, (?#…).
InlineOptions2048Inline options, (?i) and (?i:…).
Lookahead4096Lookahead, (?=…) and (?!…).
Lookbehind8192Lookbehind, (?<=…) and (?<!…).
AnchorsAZ16384The \A, \Z, \z, and \G anchors.
KeepOut32768The \K match reset.
Alternation65536Alternation with |.
PlusAndQuestionQuantifiers131072The + and ? quantifiers.
LazyQuantifiers262144Lazy quantifiers, a*?.
PossessiveQuantifiers524288Possessive quantifiers, a*+.
BareBraceIsLiteral1048576A { that does not start a well-formed bound is an ordinary character rather than an error.
Backreferences2097152Backreferences.
StrictEscapes4194304An unrecognized alphabetic escape such as \q is an error. Where the dialect lacks this, the escape stands for the character itself.
QuotedLiterals8388608Quoted literal runs, \Q…\E.
UnicodeCategories16777216Unicode categories and blocks, \p{L} and \P{L}.
UnicodeCategoriesRequireUnicodeFlag33554432Unicode categories are recognized only when the pattern opts into Unicode mode.
UnicodePropertyNames67108864Unicode property names may name a property as well as a value, as \p{Script=Greek} does, and are not checked against the .NET category and block names.
CharacterClassSubtraction134217728Character class subtraction, [a-z-[aeiou]].
PosixBracketExpressions268435456POSIX bracket expressions, [[:alpha:]].
Recursion536870912Recursion, (?R) and (?1).
BacktrackingVerbs1073741824Backtracking control verbs such as (*SKIP).
IgnorePatternWhitespace2147483648Extended mode, in which whitespace and # comments are insignificant.
EscapedGroupDelimiters4294967296Groups and bounds are written escaped, as POSIX basic expressions write \( and \{.
ClassSetOperations8589934592The class set grammar: nested classes, && and -- operators, and \q{…} string disjunctions. JavaScript turns it on with the v flag rather than having it always.