c# 正则
2021-02-19 23:21
标签:pos har group line match value post lin bsp c# 正则 标签:pos har group line match value post lin bsp 原文地址:https://www.cnblogs.com/danlis/p/8297652.html Regex reg = new Regex("^do(es)(xy)?$");
var result = reg.Match("doesxy");
foreach (var item in result.Groups)
{
Console.WriteLine(item);
}
Match result2 = reg.Match("");
foreach (var item in result2.Groups)
{
Console.WriteLine(item);
}
MatchCollection mc = Regex.Matches("1id1sid1x2id2sid2", @"\d*id(\d*)sid(\d*)");
if (mc[0].Groups.Count == 3)//会有三个匹配项的
{
for (int i = 0; i
上一篇:C#.Net环境下的缓存技术