http://www.dotnetperls.com/regex-ismatch
In the above website there is a sentence saying that:-
"The static method has two overloads, the first receiving two parameters and the second receiving three parameters".
What is meant by first receiving two parameters and the second receiving three parameters.
Loading
Posted Nov 1, 2013, 4:29 PM
Scott LyslePosted Nov 1, 2013, 9:51 AM
It is overloaded means that this function will accept different lists of arguments. In this case there are two versions of Regex.IsMatch. The first version accepts two arguments, the second overloaded version accepts three arguments.
So we can use it like this:
Version 1 (two args): Regex.IsMatch(value, @"^[a-zA-Z0-9]*$");
Or like this:
Version 2 (three args): Regex.IsMatch(value, @"^[a-zA-Z0-9]*$", RegexOptions.IgnoreCase)
VulpesPosted Nov 1, 2013, 9:45 AM
public static bool IsMatch(string input, string pattern)
public static bool IsMatch(string input, string pattern, RegexOptions options)
As you'll see the difference between the two is that the second one allows you to pass a RegexOptions value as a third parameter.
This allows you to do things such as ignoring case when matching strings and to use Multiline mode. The latter 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.
Check this MSDN link for the full list of RegexOptions values:
http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regexoptions(v=vs.110).aspx