fork(2) download
  1. re = /\w+(?=:\s*"[^"]*")/m
  2. str = '{
  3. example:"hi there",
  4. dateTime: "01/01/1970 bla:bla"
  5. }'
  6. subst = '"\\0"'
  7. result = str.gsub(re, subst)
  8.  
  9. puts result
Success #stdin #stdout 0s 28216KB
stdin
Standard input is empty
stdout
{
   "example":"hi there",
   "dateTime": "01/01/1970 bla:bla"
}