public static bool RegexValidate(string regexString, string validateString) { Regex regex = new Regex(regexString); return regex.IsMatch(validateString.Trim()); }