正则中使用分组匹配数据
(?<name>.*)
在编程中需要拿到这组数据
MatchCollection regexMatches = Regex.Matches(page.Content, "(?<name>.*)");
List<SS_Server_Model> results = new List<SS_Server_Model>();
foreach (Match match in regexMatches)
{
results.Add(new SS_Server_Model() {
SrvName = match.Groups["name"].Value,
});
}
在替换工具中使用这组符号
${name}
原文:http://www.cnblogs.com/Again/p/6387597.html