0
我可以改变CKEditor的一个词与此正则表达式,ckeditor替换字怎么添加更多?
editor = CKEDITOR.instances.txtisi;
var edata = editor.getData();
var rep_text = edata.replace("INSERT INTO", "INSERT-INTO");
editor.setData(rep_text);
但如何添加更多的话,它将取代,而不是只有一个字。我尝试了,但我总是得到最后一个词。像this.editor = CKEDITOR.instances.txtisi;
var edata = editor.getData();
var rep_text = edata.replace("INSERT INTO", "INSERT-INTO"); // you could also
var rep_text = edata.replace("DELETE TABLE", "DELETE-TABLE"); // you could also
var rep_text = edata.replace("TRUNCATE TABLE", "TRUNCATE-TABLE"); // you could also use a regex in the replace
editor.setData(rep_text);
谢谢,解决:) –