using System.Text.RegularExpressions; if (Regex.IsMatch(s, "正则表达式")) { return true; }