title: Warning: preg_match() [function.preg-match]: Compilation failed: nothing to repeat at offset
body: <p>i'm trying to change the preg_match check from url checking to username checking which is min/max 2-16chrs, dash, space &amp; hypen acceptable. i'm getting this error</p>
  
  <blockquote>
    <p><strong>Warning:</strong> preg_match() [function.preg-match]: Compilation failed: nothing to repeat at offset 14 </p>
  </blockquote>
  
  <pre><code>if(empty($string) || preg_match("#^([\w- ]{2,16}*(?:.[\w- ]{2,16}*)+):?(d+)?/?#i", $string))
  </code></pre>
  
  <p>old code that looked for URL</p>
  
  <pre><code>if(empty($string) || preg_match("#^(http|https|ftp)://([A-Z0-9][A-Z0-9_-]*(?:.[A-Z0-9][A-Z0-9_-]*)+):?(d+)?/?#i", $string))
  </code></pre>