I use double quotes for the string as a whole, and then single quotes for quotes in the string.
Example:
{
"map": "function (a, b) {var res = b.match(/(\d+)/); console.log('this is the res:' + res)}"
}
This shows I use regex escapes, and it shows how I do quotes (in the console.log fund).
This won't store properly via futon. Meaning, if I put this into a document via futon, the value will become a string, not a json object.
I think it might come down to the regex escape "\d+". If i use "d+" instead, then futon will accept the object. But then running the snippet won't work because i intend to have "\d+".
>
> —Jens