This is your question?
[x] Option A
[ ] Option B
[x] Option C
[x] Option D
[explanation]
<a href="javascript:void(0);" class="X" >View</a>
[explanation]
答案 0 :(得分:0)
为了在两个其他字符串之间替换字符串(例如,img标签),请使用此...
var output = input.replace(/(?:\r\n|\r|\n)/g, '').replace (/\[explanation\](.*?)\[explanation\]/g, "your string replacement");
答案 1 :(得分:0)
找到解决方案 -
var output = input.replace (/(\[explanation\])[\s\S]+\1/gmi, "[explanation]\n\n"+"My New String"+"\n\n[explanation]" );