Regex Constructor (String, RegexOptions)

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

Initializes a new instance of the Regex class for the specified regular expression, with options that modify the pattern.

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

'Declaration
Public Sub New ( _
	pattern As String, _
	matchFlags As RegexOptions _
)

Parameters

pattern
Type: System..::..String
The regular expression pattern to match.
matchFlags
Type: System.Text.RegularExpressions..::..RegexOptions
A bitwise combination of the enumeration values that modify the regular expression.

The pattern parameter consists of regular expression language elements that symbolically describe the string to match.

A Regex object is immutable, which means that it can be used only for the match parameters you define when you create it. However, it can be used any number of times without being recompiled.

Show: