title: How to modify a file to replace a string that matches this pattern
body: <p>I have a json file like this:</p>
  
  <pre><code>{
      "title": "Pilot",
      "image": [
          {
              "resource": "http://images2.nokk.nocookie.net/__cb20110227141960/notr/images/8/8b/pilot.jpg",
              "description": "not yet implemented"
          }
      ],
      "content": "&lt;p&gt;The pilot ...&lt;/p&gt;"
  },
  {
      "title": "Special Christmas (Part 1)",
      "image": [
          {
              "resource": "http://images1.nat.nocookie.net/__cb20090519172121/obli/images/e/ed/SpecialChristmas.jpg",
              "description": "not yet implemented"
          }
      ],
      "content": "&lt;p&gt;Last comment...&lt;/p&gt;"
  }
  </code></pre>
  
  <p>I need to replace the content from all the <strong>resource</strong> values in the file, so if 
  a string has this format: </p>
  
  <pre><code>"http://images1.nat.nocookie.net/__cb20090519172121/obli/images/e/ed/SpecialChristmas.jpg"
  </code></pre>
  
  <p>the result should be:</p>
  
  <pre><code>"../img/SpecialChristmas.jpg"
  </code></pre>
  
  <p>Could someone tell me how to match that pattern in order to modify the file?</p>
  
  <p>I tried something like this recommendation: </p>
  
  <p><a href="https://stackoverflow.com/a/4128192/521728">https://stackoverflow.com/a/4128192/521728</a></p>
  
  <p>but I don't know how to adapt it to my situation.</p>
  
  <p>Thanks in advance!</p>