lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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)