title: javascript find a random occurred string inside a string
body: <p>I need to search and find the exact image url from a webpage source wth javascript.</p>
  
  <p>Currently I can only count the occurrences.</p>
  
  <p>My code is:</p>
  
  <pre><code>var count = 0;
  var pos = res.body.indexOf("650x365");
  while(pos &gt; -1){
      ++count;
      pos = res.body.indexOf("650x365", ++pos);
  }
  console.log(count);    // 2
  </code></pre>
  
  <p>url is like this</p>
  
  <pre><code>http://img.sa.com/c/1/70/650x365/bp/02112015_esa.jpg
  </code></pre>