考虑以下函数参数(它们已经从函数中提取):
Monkey,"Blue Monkey", "Red, blue and \"Green'", 'Red, blue and "Green\''
有没有办法使用正则表达式提取参数以获取以下数组输出并去除空格:
[Monkey, "Blue Monkey", "Red, blue and \"Green'", 'Red, blue and "Green\'']
我坚持使用这个不够宽松的 RegExp:
/(("[^"]+"|[^\s,]+))/g