【发布时间】:2025-12-24 23:20:16
【问题描述】:
例子:
test "testing 123! :)" // -> ['test', 'testing 123! :)']
test "\"testing these are some nice quotes!\"" // -> ['test', '"testing these are some nice quotes!\"']
有没有办法用 JavaScript 中的正则表达式来做到这一点?也许它也可以与 --flag=value 一起使用!
【问题讨论】:
-
这能回答你的问题吗? Split a string by commas but ignore commas within double-quotes using Javascript。只需要自定义 REGEX。
标签: javascript arrays regex