RegexDialectFeatures Enum
The optional constructs a RegexDialect supports.
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
| Name | Value | Description |
|---|---|---|
None | 0 | |
ExtendedGroupSyntax | 1 | The (?…) 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. |
NonCapturingGroups | 2 | Non-capturing groups, (?:…). |
NamedGroups | 4 | Named groups in any spelling. |
AngleNamedGroups | 8 | Angle-bracket named groups, (?<name>…). |
QuoteNamedGroups | 16 | Single-quoted named groups, (?'name'…). |
PythonNamedGroups | 32 | Python-style named groups, (?P<name>…). |
BalancingGroups | 64 | Balancing groups, (?<current-previous>…). |
AtomicGroups | 128 | Atomic groups, (?>…). |
BranchReset | 256 | Branch reset groups, (?|…). |
Conditionals | 512 | Conditional alternations, (?(1)yes|no). |
CommentGroups | 1024 | Comment groups, (?#…). |
InlineOptions | 2048 | Inline options, (?i) and (?i:…). |
Lookahead | 4096 | Lookahead, (?=…) and (?!…). |
Lookbehind | 8192 | Lookbehind, (?<=…) and (?<!…). |
AnchorsAZ | 16384 | The \A, \Z, \z, and \G anchors. |
KeepOut | 32768 | The \K match reset. |
Alternation | 65536 | Alternation with |. |
PlusAndQuestionQuantifiers | 131072 | The + and ? quantifiers. |
LazyQuantifiers | 262144 | Lazy quantifiers, a*?. |
PossessiveQuantifiers | 524288 | Possessive quantifiers, a*+. |
BareBraceIsLiteral | 1048576 | A { that does not start a well-formed bound is an ordinary character rather than an error. |
Backreferences | 2097152 | Backreferences. |
StrictEscapes | 4194304 | An unrecognized alphabetic escape such as \q is an error. Where the dialect lacks this, the escape stands for the character itself. |
QuotedLiterals | 8388608 | Quoted literal runs, \Q…\E. |
UnicodeCategories | 16777216 | Unicode categories and blocks, \p{L} and \P{L}. |
UnicodeCategoriesRequireUnicodeFlag | 33554432 | Unicode categories are recognized only when the pattern opts into Unicode mode. |
UnicodePropertyNames | 67108864 | Unicode 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. |
CharacterClassSubtraction | 134217728 | Character class subtraction, [a-z-[aeiou]]. |
PosixBracketExpressions | 268435456 | POSIX bracket expressions, [[:alpha:]]. |
Recursion | 536870912 | Recursion, (?R) and (?1). |
BacktrackingVerbs | 1073741824 | Backtracking control verbs such as (*SKIP). |
IgnorePatternWhitespace | 2147483648 | Extended mode, in which whitespace and # comments are insignificant. |
EscapedGroupDelimiters | 4294967296 | Groups and bounds are written escaped, as POSIX basic expressions write \( and \{. |
ClassSetOperations | 8589934592 | The class set grammar: nested classes, && and -- operators, and \q{…} string disjunctions. JavaScript turns it on with the v flag rather than having it always. |