为什么 /pattern/ 匹配,但 RegExp 不匹配?
<div id="foo">
##content##
<h1>works!</h1>
##/content##
</div>
<script>
var str = document.getElementById("foo").innerHTML;
console.log(str);
var r = new RegExp("##content##([\S\s]*)##\/content##", "img");
console.log(r.exec(str)); //null
console.log(str.match(/##content##([\S\s]*)##\/content##/img)); //matches
</script>