正则择一匹配多个
string sttr = "123addyou恩啊1a";
MatchCollection coll = Regex.Matches(sttr, @"[a-z]|\d");
foreach (Match m in coll) {
   Console.WriteLine(m.ToString());
}

Matches()方法匹配符合子字符串集合

这里匹配单个数字或者是a-z的字母


首页 我的博客
粤ICP备17103704号