Can Someone explain this reg ex to me?

aglahh5rug

New Member
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 \[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\]
 
Back
Top