获取除了html标签之外的所有字符串
示例:
string a = "fds<font style=\"color:#FFFF37\">st</font>abc";
要获取a变量中的这些字符串:“fds”,“st”,“abc”。请问正则表达要怎么写?
备注:html标签是不确定的,此此处用forn只是举个例子
修改一下,把html注释也去掉:学习林俊德心得体会
C# code string s = File.ReadAllText(@"E:\ASP.NET\cfamilystudy/index.aspx");
string[] results = Regex.Split(s, @"(?is)<!?/?[^>]*/?>").Where(x => x.Trim().Length > 0).ToArray();
foreach (string result in results)
Response.Write(result + "<br/>");
string a = "fds<font style=\"color:#FFFF37\">st</font>abc";
a=Regex.Replace(a,"<[^>]*?>","");