用正则表达式找出不包含连续字符串abc的单词

[^abc]表示不包含a、b、c中任意字符, 我想实现不包含字符串abc应该如何写表达式?

从网上找的,简洁的写法:\b((?!abc)\w)+\b

如:

从html标记中取出文字内容和图片

using System.Text.RegularExpressions;

--------------------------------------

 string ohtml = "afdsfasd<span>span2</span><m><p>asdf</p>sdfsd</m><i>kkk</i><b>bbbb</b><input class=\"del\" onclick='Del(\"m1\")' value=\"X\" type=\"button\"> <img src=><span>span</span>";
            Response.Write(Regex.Replace(ohtml, @"<(\b((?!img)\w)+\b|/).*?(>|/>)", ""));

--------------------------------------

原文地址:https://www.cnblogs.com/wenming205/p/1495171.html