C# 正则表达式 实现 将特定内容 放到集合中

时间:2015/12/3 17:27:00来源:互联网 作者:flyso 点击: 1422 次

var list = Regex.Matches(str, @"(?is)<ST:(?=[^>]*?id=([""'])(?<id>[^""']+)\1)(?=[^>]*?tooltip=([""'])(?<tooltip>[^""']+)\2)[^>]*>").OfType<Match>().Select(t => new { id = t.Groups["id"].Value, tooltip = t.Groups["tooltip"].Value }).ToList();

Copyright © 2005 - 2016 flyso.cn. 飞搜 版权所有 鄂ICP备11002783号-3