title: Javascript: find URLs in a document
body: <p>how do I find URLs (i.e. www.domain.com) within a document, and put those within anchors: &lt; a href="www.domain.com" >www.domain.com&lt; /a ></p>
  
  <p>html:</p>
  
  <pre><code>Hey dude, check out this link www.google.com and www.yahoo.com!
  </code></pre>
  
  <p>javascript:</p>
  
  <pre><code>(function(){var text = document.body.innerHTML;/*do replace regex =&gt; text*/})();
  </code></pre>
  
  <p>output:</p>
  
  <pre><code>Hey dude, check out this link &lt;a href="www.google.com"&gt;www.google.com&lt;/a&gt; and &lt;a href="www.yahoo.com"&gt;www.yahoo.com&lt;/a&gt;!
  </code></pre>