RegexPatternOptions Enum

The options that change how a pattern is read.

[Flags]
public enum RegexPatternOptions

Remarks

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

NameValueDescription
None0
IgnoreCase1Case-insensitive matching. Set by (?i) and by the JavaScript i flag.
Multiline2^ and $ match at line boundaries. Set by (?m) and by the JavaScript m flag.
Singleline4. matches a line feed. Set by (?s); the JavaScript spelling is RegexPatternOptions.DotAll.
ExplicitCapture8Only named groups capture. Set by (?n).
IgnorePatternWhitespace16Whitespace and # comments are insignificant. Set by (?x).
EcmaScript32ECMAScript-compatible behaviour, as RegexOptions.ECMAScript defines it.
Unicode64The JavaScript u flag: the pattern is read as a sequence of code points.
UnicodeSets128The JavaScript v flag: RegexPatternOptions.Unicode plus class set operations.
DotAll256The JavaScript s flag. The .NET spelling is RegexPatternOptions.Singleline.
Global512The JavaScript g flag. It does not change the syntax tree; it is kept so a literal round-trips.
Sticky1024The JavaScript y flag. It does not change the syntax tree; it is kept so a literal round-trips.
HasIndices2048The JavaScript d flag. It does not change the syntax tree; it is kept so a literal round-trips.