|
Oops, that would be: LUA = JSON :gsub('([^\\])\\"', '%1\3') :gsub('"[^"]*"', function(s) return s:gsub('[%[%]]', {['[']='\1', [']']='\2'}) end) :gsub('[%[%]]', {['[']='{', [']']='}'}) :gsub('("[^"]*")%s*:', '[ %1 ] =') :gsub('[\1\2\3]', {['\1']='[', ['\2']=']', ['\3']='\\"'}) (Sorry for the noise)