title: Auto-link URL with javascript Regex
body: <p>I have a paragraph of text which may contain some links in plain text, or some links which are <em>actually</em> links.</p>
  
  <p>For example:</p>
  
  <pre><code>Posting a link: http://test.com, posting an image &lt;img src="http://test.com/2.jpg" /&gt;. Posting an actual A tag: &lt;a href="http://test.com/test.html"&gt;http://test.com/test.html&lt;/a&gt;
  </code></pre>
  
  <p>I need to fish out the unformatted links from this piece of text. So any regular expression that will match the first case, but not the second or third case because they are already well formatted links.</p>
  
  <p>I've managed to fish out all the links with this regex: <code>((http:|https:)\/\/[a-zA-Z0-9&amp;#=.\/\-?_]+)</code>, however, am still having trouble distinguishing between the cases.</p>
  
  <p>This needs to be in javascript so I don't think negative lookbehind is allowed.</p>
  
  <p>Any help would be appreciated.</p>
  
  <p><strong>EDIT:</strong> I'm trying to wrap the fished out unformatted links in an a tag.</p>