首先你这太省事了,至少把原文粘贴出来吧。
正则代码:查找 <div class="ivu-tooltip-inner">([^<]*)<\/div>
替换为 <div class="ivu-tooltip-inner">\1<\/div>
start.replace("<script.*?<\/script>\s<(?!br\/)[^>]+>","<\/script>")换成
start.replace(/<\/script>\s*<br\s*\/[^>]*>/igm,"</script>")试试看,大致代码如下(把<div class="cc">我爱世界杯</div>变成了<div class="cc">我爱奥运会</div>)namespace ConsoleApplication1
{
using System
using System.Text.RegularExpressions
class Program
{
static void Main(string[] args)
{
const string sampleInput = "<div class=\"cc\">我爱世界杯</div>"
const string replacedWith = "我爱奥运会"
var result = Regex.Replace(sampleInput, "(<div class=\"cc\">).+(</div>)", "$1" + replacedWith + "$2")
Console.WriteLine(result)
}
}
}