On Feb 1, 2008, at 11:31 PM, Eric Tetz wrote:
LUA = JSON
:gsub('([^\\])\\"', '%13円')
:gsub('"[^"]*"', function(s)
return s:gsub('[%[%]]', {['[']='1円', [']']='2円'}) end)
:gsub('[%[%]]', {['[']='{', [']']='}'})
:gsub('("[^"]*")%s*:', '[ %1 ] =')
:gsub('[1円2円3円]', {['1円']='[', ['2円']=']', ['3円']='\\"'})
Cool :) Here is a take from the ruby people: http://groups.google.com/group/comp.lang.ruby/msg/c7e90caa0cfd8aa2