title: php regex: phone number 7-12 digits may contain hypen or space
body: <p>I tried the solution for phone numbers with 7-12 digits that may contain spaces or hypens in the following link. The first and last character has to be a number.</p>
  
  <p><a href="https://stackoverflow.com/questions/2095711/regular-expression-to-match-7-12-digits-may-contain-space-or-hyphen">Regular expression to match 7-12 digits; may contain space or hyphen</a></p>
  
  <p>However, i'm not understanding the regex well.</p>
  
  <pre><code>$phone_pattern="/^\d(?:[-\s]?\d){6,11}$/";
  </code></pre>
  
  <p>what does the ":" mean here? </p>
  
  <p>How is this regex able to exclude the hypens and spaces from the 6 to 11 characters?</p>
  
  <p>Help help is highly appreciated</p>