IsMatchRegex

 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());

Description

Check if a string is match with given regular expression pattern

Details

Double click on the code to select all.

 

;