title: Can Someone explain this reg ex to me?
body: <p>I recently asked a question on formatting a telephone number and I got lots of responses. Most of the responses were great but one i really wanted to figure out what its doing because it worked great. If phone is the following how do the other lines work...what are they doing so i can learn   </p>
  
  <pre><code>$phone = "(407)888-9999";
  
  $phone = preg_replace("~[^0-9]~", "", $phone);
  preg_match('~([0-9]{3})([0-9]{3})([0-9]{4})~', $phone, $matches);
  </code></pre>