This sample takes a phone number in any old format and attempts to wrangle it
into a nice uniform format. It's great to use for form validation, before placing the
number into a database, or to create good looking reports.
I used the "(800) 555-1212" format, but changing it to whatever
format you prefer is simple. Just for fun I also threw in some basic error handling
for when the number doesn't have 10 digits (or 11 if the first is a 1). The error
handling is quite trivial, but it is in there if you want to build on it.