110,530
社区成员
发帖
与我相关
我的任务
分享
string str = "<a href=\"123\" class=\"456\" style=\"789\">000 </a> ";
string pstr = @"<a( href=""(?<href>[^""]*)""| class=""(?<class>[^""]*)""| style=""(?<style>[^""]*)"")+>(?<atxt>[^<]*)</a>";
Match m = Regex.Match(str, pstr);
if (m.Success)
{
Response.Write(m.Groups["href"].Value + m.Groups["class"].Value + m.Groups["style"].Value);
}