IsMatchRegex
Check if a string is match with given regular expression pattern
Source
public static bool IsMatchRegex(this string value, string pattern)
{
Regex regex = new Regex(pattern);
return (regex.IsMatch(value));
}
Example
string s = "test";
MessageBox.Show(s.IsMatchRegex(@"[a-z]").ToString());