title: Regex to find URLs not in tags
body: <p>I am breaking my head on this:</p>
  
  <p>I am trying to find URLs in Javascript with regex.</p>
  
  <p>Update: I use Javascript on serverside, so I can not walk through the DOM</p>
  
  <pre><code>(http:\/\/|https:\/\/|)(www\.)([a-zA-Z0-9]+\.[a-zA-Z0-9\-]+|[a-zA-Z0-9\-]+)\.[a-zA-Z\.]{2,6}(\/[a-zA-Z0-9\.\?=\/#%&amp;\+-]+|\/|)/gi
  </code></pre>
  
  <p>The above sample is working great. 
  But I need to change the regex that Urls won't be found in: <code>href="url"</code> and not in <code>&lt;a ....&gt;url&lt;/a&gt;</code> but in anything else like <code>&lt;p ...&gt;url&lt;/p&gt;</code> or <code>&lt;div ....&gt;text text text url, url, url text text&lt;/div&gt;</code></p>
  
  <p>Can anybody help?</p>
  
  <p>Thank you and cheers
  Michael</p>