title: Custom Javascript Regex - Cannot make it work
body: <p>I need to accept the following:</p>
  <ul>
  <li>x{1}.xxxxx{1,40}</li>
  <li>x{1}.xxxxx{1,40}-xxxxx{1,40}</li>
  <li>xxxxx{1,40}</li>
  <li>xxxxx{1,40}-xxxxx{1,40}</li>
  <li>xxxx xxxxx xxxxx{words with space between}</li>
  </ul>
  <p>My regex is not working...</p>
  <pre><code>/^([a-z]{1}\.[a-z]{1,40}|[a-z]{1}\.[a-z]{1,40}\-[a-z]{1,40}|[a-z\s]{1,})$/i
  </code></pre>
  <p>While</p>
  <pre><code>/^([a-z]{1}\.[a-z]{1,40}|[a-z]{1}\.[a-z]{1,40}\-[a-z]{1,40})$/i
  </code></pre>
  <p>alone is working OK and</p>
  <pre><code>/^([a-z\s]{1,})$/i
  </code></pre>
  <p>is working OK as well...</p>
  <p>What am I doing wrong?
  Thank you in advance...</p>