title: Format to JSON with regex
body: <p>I have read a file with a JSON appearance, and the format is similar to the following:</p>
  
  <pre><code>{
      varParent1: {
          var1: true,
          var2: "this is a string",
          var3: 0,
          var4: "another string"
      },
      varParent2:{
          var1: false,
          var2: 0,
          var3: 92,
          var4: "string here",
          var5: "string2 here"
      }
  }
  </code></pre>
  
  <p>I have this code in a variable, but I can't edit the file, so I should work only with the variable.</p>
  
  <p>As everybody can see, it is not a valid format JSON, so I am not being able to parse it. I need to format it to something like this:</p>
  
  <pre><code>{
      "varParent1": {
          "var1": true,
          "var2": "this is a string",
          "var3": 0,
          "var4": "another string"
      },
      "varParent2":{
          "var1": false,
          "var2": 0,
          "var3": 92,
          "var4": "string here",
          "var5": "string2 here"
      }
  }
  </code></pre>
  
  <p>I have thought about the logic and I have a conclusion (I think it's fine): I have to add '"' to the start and end of every line and between ":" too. But i'm not able to do that with regex.</p>
  
  <p>Is there an easier way? </p>