title: How to grep for a URL in a file?
body: <p>For example, I have a huge HTML file that contains img URL: <a href="http://ex.example.com/hIh39j+ud9wr4/Uusfh.jpeg" rel="noreferrer">http://ex.example.com/hIh39j+ud9wr4/Uusfh.jpeg</a></p>
  
  <p>I want to get this URL, assuming it's the <em>only</em> url in the entire file.</p>
  
  <pre><code>cat file.html | grep -o 'http://ex[a-zA-Z.-]*/[a-zA-Z.-]*/[a-zA-Z.,-]*'
  </code></pre>
  
  <p>This works <strong>only</strong> if the URL doesn't have the plus signs.</p>
  
  <p>How do I make work for + signs as well?</p>