Skip to content

Instantly share code, notes, and snippets.

@larruda
Last active November 22, 2022 09:49
Show Gist options
  • Select an option

  • Save larruda/967110d74d98c1cd4ee1 to your computer and use it in GitHub Desktop.

Select an option

Save larruda/967110d74d98c1cd4ee1 to your computer and use it in GitHub Desktop.

Revisions

  1. larruda renamed this gist Aug 4, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. larruda revised this gist Aug 4, 2014. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion key_json.js
    Original file line number Diff line number Diff line change
    @@ -1 +1,2 @@
    string.replace(/(\s*?{\s*?|\s*?,\s*?)(['"])?([a-zA-Z0-9]+)(['"])?:/g, '$1"$3":');
    json_string.replace(/(\s*?{\s*?|\s*?,\s*?)(['"])?([a-zA-Z0-9]+)(['"])?:/g, '$1"$3":');
    eval('var json = new Object(' + json_string + ')');
  3. larruda renamed this gist Aug 4, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. larruda created this gist Aug 4, 2014.
    1 change: 1 addition & 0 deletions gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    string.replace(/(\s*?{\s*?|\s*?,\s*?)(['"])?([a-zA-Z0-9]+)(['"])?:/g, '$1"$3":');