title: URL regex does not work in javascript
body: <p>I am trying to use <a href="http://daringfireball.net/2010/07/improved_regex_for_matching_urls" rel="nofollow">John Gruber's URL regex</a> in Javascript but NetBeans keeps telling me there is a syntax error and illegal errors:</p>
  
  <pre><code> var patt = "/(?i)\b((?:[a-z][\w-]+:(?:/{1,3}|[a-z0-9%])
  |www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]
  {2,4}/)(?:[^\s()&lt;&gt;]+|\(([^\s()&lt;&gt;]+|
  (\([^\s()&lt;&gt;]+\)))*\))+(?:\(([^\s()&lt;&gt;]+|
  (\([^\s()&lt;&gt;]+\)))*\)|[^\s`!()\[\]{};:
  '".,&lt;&gt;?«»“”‘’]))/";
  </code></pre>
  
  <p>Anyone know how to solve this?</p>