string x= "搜索结果:1,312,224 个中的 1 - 20 个符合您的搜索条件"。
需要验证它是否包含“搜索结果:(X) 的 1 - 20 个用于您的搜索条件”并且 (x) 可以是任何数字
这是代码
var r = new Regex(@"Search Results: 1 - 20 of [0-9,]+ for your search criteria");
if (r.IsMatch(x)) {
// yes, match, do your stuff
}
你想要这样的东西吗?
Regex rgx = new Regex(@"Search Results: 1 - 20 of ([\d,]+) for your search criteria");
Search Results: 1 - 20 of ([0-9]+,)+[0-9]+ for your search criteria