RegexOptions Enumeration

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Provides enumerated values to use to set regular expression options.

This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.

Namespace:  System.Text.RegularExpressions
Assembly:  System.Text.RegularExpressions (in System.Text.RegularExpressions.dll)

public enum RegexOptions

Member nameDescription
CompiledSpecifies that the regular expression is compiled to an assembly. This yields faster execution but increases startup time. This value should not be assigned to the Options property when calling the CompileToAssembly method.
CultureInvariantSpecifies that cultural differences in language is ignored.
ECMAScriptEnables ECMAScript-compliant behavior for the expression. This value can be used only in conjunction with the IgnoreCase, Multiline, and Compiled values. The use of this value with any other values results in an exception.
ExplicitCaptureSpecifies that the only valid captures are explicitly named or numbered groups of the form (?<name>…). This allows unnamed parentheses to act as noncapturing groups without the syntactic clumsiness of the expression (?:…).
IgnoreCaseSpecifies case-insensitive matching.
IgnorePatternWhitespaceEliminates unescaped white space from the pattern and enables comments marked with #.
MultilineMultiline mode. Changes the meaning of ^ and $ so they match at the beginning and end, respectively, of any line, and not just the beginning and end of the entire string.
NoneSpecifies that no options are set.
SinglelineSpecifies single-line mode. Changes the meaning of the dot (.) so it matches every character (instead of every character except \n).