title: Different regex conditions on same string
body: <p>I am trying to implement a regex for phone numbers, based on our business logic.</p>
  
  <p>What the customer wants is that the phone must contain between 8 and 15 characters of numbers, and also can contain any spaces and dots anywhere which doesn't add to the count of numbers. So, theoretically this should be valid:</p>
  
  <pre><code>3          ....            44444444
  </code></pre>
  
  <p>Because it contains 9 numbers.</p>
  
  <p>I can't really go further on </p>
  
  <pre><code>~[0-9\.\ ]{8,15}$
  </code></pre>
  
  <p>but obviously it counts dots and spaces to the limit too.</p>
  
  <p>Is it even possible to implement it via regex?</p>