title: Replace URL or fully qualified domain name with link
body: <p>I am not good at regular exp. 
  and I want to change the link to hyperlinks in a text </p>
  
  <p>for example </p>
  
  <pre><code>Hello http://stackoverflow.com
  Hello www.stackoverflow.com
  </code></pre>
  
  <p>I want the stackoverflow to link </p>
  
  <pre><code>Hello &lt;a href='http://stackoverflow.com'&gt;http://stackoverflow.com&lt;/a&gt;
  Hello &lt;a href='http://www.stackoverflow.com'&gt;www.stackoverflow.com&lt;/a&gt;
  </code></pre>
  
  <p>I used this </p>
  
  <pre><code>var exp = /(\b(https?|ftp|file|):\/\/[-A-Z0-9+&amp;@#\/%?=~_|!:,.;]*[-A-Z0-9+&amp;@#\/%=~_|])/ig;
          return str.replace(exp,"&lt;a href='$1' target='_blank'&gt;$1&lt;/a&gt;"); 
  </code></pre>
  
  <p>But this is only with http:// </p>
  
  <p>Thank in advance </p>