RegexPatternOptions Enum
The options that change how a pattern is read.
[Flags]
public enum RegexPatternOptionsRemarks
These are the options an engine is given alongside the pattern, and the ones an inline construct such as (?i) or a JavaScript flag letter can set. Options that only affect matching, such as RegexOptions.Compiled, are not represented because they cannot change the syntax tree.
Fields
| Name | Value | Description |
|---|---|---|
None | 0 | |
IgnoreCase | 1 | Case-insensitive matching. Set by (?i) and by the JavaScript i flag. |
Multiline | 2 | ^ and $ match at line boundaries. Set by (?m) and by the JavaScript m flag. |
Singleline | 4 | . matches a line feed. Set by (?s); the JavaScript spelling is RegexPatternOptions.DotAll. |
ExplicitCapture | 8 | Only named groups capture. Set by (?n). |
IgnorePatternWhitespace | 16 | Whitespace and # comments are insignificant. Set by (?x). |
EcmaScript | 32 | ECMAScript-compatible behaviour, as RegexOptions.ECMAScript defines it. |
Unicode | 64 | The JavaScript u flag: the pattern is read as a sequence of code points. |
UnicodeSets | 128 | The JavaScript v flag: RegexPatternOptions.Unicode plus class set operations. |
DotAll | 256 | The JavaScript s flag. The .NET spelling is RegexPatternOptions.Singleline. |
Global | 512 | The JavaScript g flag. It does not change the syntax tree; it is kept so a literal round-trips. |
Sticky | 1024 | The JavaScript y flag. It does not change the syntax tree; it is kept so a literal round-trips. |
HasIndices | 2048 | The JavaScript d flag. It does not change the syntax tree; it is kept so a literal round-trips. |