title: Regex not working as expected in JavaScript
body: <p>I wrote the following regex:</p>
  
  <pre><code>(https?:\/\/)?([da-z\.-]+)\.([a-z]{2,6})(\/(\w|-)*)*\/?
  </code></pre>
  
  <p>Its behaviour can be seen here: <a href="http://gskinner.com/RegExr/?34b8m" rel="nofollow">http://gskinner.com/RegExr/?34b8m</a></p>
  
  <p>I wrote the following JavaScript code:</p>
  
  <pre><code>var urlexp = new RegExp(
      '^(https?:\/\/)?([da-z\.-]+)\.([a-z]{2,6})(\/(\w|-)*)*\/?$', 'gi'
  );
  document.write(urlexp.test("blaaa"))
  </code></pre>
  
  <p>And it returns <code>true</code> even though the regex was supposed to not allow single words as valid.</p>
  
  <p>What am I doing wrong?</p>