将字符串数组更改为字符串数组

d13*_*d13 1 javascript regex string

我有一个包含数组的字符串:

"[one, two, three]"
Run Code Online (Sandbox Code Playgroud)

我想把它改成一个字符串数组,如下所示:

["one", "two", "three"]
Run Code Online (Sandbox Code Playgroud)

任何帮助将非常感谢!

更新:谢谢大家的帮助,你可以在这里看到这个结果:http: //kittykatattack.github.io/storymaker/

lea*_*eaf 5

试试这个 :

'[one, two, three]'.match(/\w+/g);
Run Code Online (Sandbox Code Playgroud)