DEV Community

Discussion on: A simple way to replace npm scripts in Deno

 
vonheikemen profile image
Heiker

For that you would get.

[ "echo", "'And", "he", "said:", "My name is!", "aa'" ]

See, the double quotes stayed, but everything else is broken. Having a bulletproof regex is a real pain. If you want to improve it, you have to modify this var myRegexp = /[^\s"]+|"([^"]*)"/gi;.