我有这段文字:
<script type="text/javascript" id="wordpress_grazit_script">
var dbnurls = [];
var dbnanchors = [];
dbnurls.push('url');
dbnanchors.push('anchor');
var script = document.createElement("script");
script.setAttribute("src", dbn_protocol+"path to js");
script.setAttribute("type", "text/javascript");
script.setAttribute("id", "grazit_script");
document.getElementById("my-id").parentNode.appendChild(script);
</script>
我需要用其他东西替换 dbn_protocol+"path to js"。
我尝试使用这种匹配模式,但它一直匹配到最后一个);
"script\\.setAttribute\\([\"']src[\"'],(.*[^\\);])(\\);)(.*)"
我需要在 c# .net 中指定我需要这个正则表达式
谢谢