我想用逗号分隔值。
但是,根据需要,我的一个JSON返回如下值。在值内,文本有逗号。。不知道如何删除逗号和组合在一起。
var str = "South Georgia and The South Sandwich Islands,Congo, Democratic Republic,Mauritania,Finland";
var res = str.split(/(?<=\w),(?=\w)/i);
console.log(res)
在这里它按预期工作。
但是,当我在gulp包中运行这个语法时。。得到
分析错误:正则表达式无效:/(?<=\w),(?=\w)/:无效组
请告诉我是否有语法可以使用?我不能用拆分(',')来满足我们的要求。