regex class : IsMatch(string) method

Description

Gets a value that Indicates whether there is a match in the argument.

Syntax

regexInstance.IsMatch(string source)

Arguments

ClassNameDescription
stringsourceA string which is searched.

Return value

ClassDescription
boolA value that Indicates whether there is a match in the argument.

Sample code

1:

regex pattern = new regex("(a+)");

2:

bool isMatch = pattern.IsMatch("aaabbbaaccc"); // true.

Notes

It's a wrapper of the System.Text.RegularExpressions.Regex.IsMatch(String) method

Links for reference

Copyright © Cooker All rights reserved.