IsMatch Method (String)

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

Indicates whether the regular expression specified in the Regex constructor finds a match in a specified input string.

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

public bool IsMatch(
	string search
)

Parameters

search
Type: System..::..String
The string to search for a match.

Return Value

Type: System..::..Boolean
true if the regular expression finds a match; otherwise, false.

The IsMatch method is typically used to validate a string or to ensure that a string conforms to a particular pattern without retrieving that string for subsequent manipulation. If you want to determine whether one or more strings match a regular expression pattern and then retrieve them for subsequent manipulation, call the Match or Matches method.

Show: