in reply to How do I parse a telephone number?
Based on jlistf's answer:
Works on strings such as the following:( undef, $areacode, $exchange, $line ) = $phn =~ m|(1-)?\(?(\d{3})\)?-?(\d{3})-(\d{4})|;
212-555-1212 (212)555-1213 1-(212)-555-1214 1-212-555-1215
Originally posted as a Categorized Answer.
|
|---|