正则表达式拆分成数组
string a="PT<0101,Field>*PT<010203,MonthSum>+345*(PT<0101,Field>+PT<01091,Field>)"
拆分成如下数组:PT<0101,Field>
PT<010203,MonthSum>
PT<0101,Field>
PT<01091,Field>
大虾些只有40分
------解决方案--------------------string a = "PT<0101,Field>*PT<010203,MonthSum>+345*(PT<0101,Field>+PT<01091,Field>)";
string[] result = Regex.Matches(a, @"PT\<\d+\,\w+?\>").Cast<Match>().Select(x => x.Value).ToArray();
------解决方案--------------------string[] result = Regex.Matches(a, @"(?<=PT<)[^<>]+(?=>)").OfType<Match>().Select(x => x.Value).ToArray();
------解决方案--------------------
string[] result = Regex.Matches(a, @"PT\<(\d+\,\w+?)\>").Cast<Match>().Select(x => x.Groups[1].Value).ToArray();