title: How do I get a selection from the output of a grep
body: <p>I have the following text in a file :  </p>
  
  <pre><code>&lt;img id="img_1" style="display: none" src="Logs/P2P2014-04-10_14-24-49.txt"/&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;script type="text/javascript"&gt;document.getElementById('duration').innerHTML = "Finished in &lt;strong&gt;1m31.846s seconds&lt;/strong&gt;";&lt;/script&gt;&lt;script type="text/javascript"&gt;document.getElementById('totals').innerHTML = "1
  </code></pre>
  
  <p>What I want to do is obtain the stuff after the src i.e. <code>Logs/P2P2014-04-10_14-24-49.txt</code>. I tried the following and put it into a variable in ruby or so : </p>
  
  <p>I tried doing :</p>
  
  <pre><code>text = `grep 'Logs\/.*txt\"'`
  </code></pre>
  
  <p>But that returns the entire damn line instead of only the text. How do I get this done?</p>