I thought I'd space out after every letter in a string, for example foo becomes f o o
What I'm thinking is 'foo'.replace(//g, ' '); ( the g flag to replace every instance, otherwise I wouldn't want regex, would I :) ).
I only have one slight problem... in JavaScript, // is a comment, so it does not work.
How can I achieve this typing a regex literal (with slashes), or is it not possible and I would have to create (by typing) a Regex object?


/(?:)/g, going bynew RegExp('', 'g').toString()./()/gis simpler because there's no capturing going on here. (Which is what I posted in my answer)