Indicates whether the specified regular expression finds a match in the specified input string, using the specified matching options.
true if the regular expression finds a match; otherwise, false.
The erload:System.Text.RegularExpressions.Regex.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 erload:System.Text.RegularExpressions.Regex.Match or erload:System.Text.RegularExpressions.Regex.Matches method.
The static Regex.IsMatch(string, string, RegexOptions) method is equivalent to constructing a System.Text.RegularExpressions.Regex object with the regular expression pattern specified by pattern and the regular expression options specified by options and calling the Regex.IsMatch(string) instance method. This regular expression pattern is cached for rapid retrieval by the regular expression engine.
The pattern parameter consists of regular expression language elements that symbolically describe the string to match. For more information about regular expressions, see .NET Framework Regular Expressions and Regular Expression Language Elements.
The System.Text.RegularExpressions.RegexMatchTimeoutException exception is thrown if the execution time of the matching operation exceeds the time-out interval specified for the application domain in which the method is called. If no time-out is defined in the application domain's properties, or if the time-out value is Regex.InfiniteMatchTimeout, no exception is thrown.