title: Why does this regular expression for ranges fail?
body: <p>The intention is to create a regular expression that parses inclusive (<code>..</code>) and exclusive (<code>...</code>) ranges from a given string.</p>
  
  <p>My edge cases are the following:</p>
  
  <ol>
  <li>The <code>initial</code> and <code>final</code> values of the range can't contain spaces.</li>
  <li>Only inclusive (<code>..</code>) and exclusive (<code>...</code>) ranges are accepted.</li>
  <li>The <code>final</code> value can't contain dots (<code>.</code>) at the beginning. </li>
  <li>The whole string should be a valid range.</li>
  </ol>
  
  <p>That said, a string with an invalid representation of a range would be:</p>
  
  <ul>
  <li><code>"1 2..20"</code>, <code>"1 2...20"</code>, <code>"12..2 0"</code></li>
  <li><code>"1....10"</code> or <code>"</code>1.10`</li>
  </ul>
  
  <p>This is the regular expression I got so far</p>
  
  <p><code>/\A([^.\s]+)(\.{2,3})([^.][^\s]+)\z/</code></p>
  
  <p>However it fails. It seems the cause is the <code>[^.]</code> part in the third capture group. It works very well without the <code>[^.]</code>, but unfortunately does not cover all the cases.</p>
  
  <p>I'm using Ruby 2.2.1.</p>