string str = "asdasd开始ajkssdhjahdadopajdpoa结束adsasdasd"; string pattern = "开始.*?结束"; var regexs = Regex.Matches(str, pattern); foreach (var item in regexs) { Console.WriteLine(item.ToString()); } Console.ReadLine();
string str = "asdasd开始ajkssdhjahdadopajdpoa结束adsasdasd"; string pattern = "开始.*?结束"; var regexs = Regex.Matches(str, pattern); foreach (var item in regexs) { Console.WriteLine(item.ToString()); } Console.ReadLine();