c#择一匹配符

189 阅读1分钟
string s = "abcd999(((#$字符";
            string pattern = @"\d|[a-z]";
            MatchCollection col = Regex.Matches(s, pattern);
            foreach(Match match in col)
            {
                Console.WriteLine(match);
            }
            Console.ReadKey();