我不想删除该字符串中第一组引号之外的任何字符:
toastr.warning("Cynthia Open Chat and respond to request","",{"timeOut":5000,"progressBar":true,})
结果是Cynthia G. 打开聊天并响应请求
。
我本来打算使用类似这样的 /\w.*(?="\w){1}/
但这似乎不起作用。
最佳答案
更容易使用匹配
:
var str = 'toastr.warning("Cynthia Open Chat and respond to request","",{"timeOut":5000,"progressBar":true,})';
var repl = str.match(/"[^"]*/)[0].substring(1);
//=> Cynthia Open Chat and respond to request
关于javascript - 删除 Javascript/JQuery 中第一组引号之外的所有内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34664000/