title: URL regex validation
body: <p>i made that:</p>
  
  <pre><code> /^(http[s]?://){0,1}(www.){0,1}[a-zA-Z0-9\.\-]+\.[a-zA-Z]{2,5}[\.]{0,1}
  </code></pre>
  
  <p>and checked it with a validator but on my page it is not working:</p>
  
  <pre><code>var re = /^(http[s]?://){0,1}(www.){0,1}[a-zA-Z0-9\.\-]+\.[a-zA-Z]{2,5}[\.]{0,1};
  if (!re.test(url)) { 
      alert("url error");
      return false;
  }
  </code></pre>
  
  <p>i get this error</p>
  
  <pre><code>Webpage error details
  
  User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)
  Timestamp: Tue, 30 Nov 2010 14:23:10 UTC
  
  
  Message: Expected ')' in regular expression
  Line: 781
  Char: 23
  Code: 0
  URI: http://*************************
  </code></pre>