J
jtbutler78
I was wondering if anyone knew how to get the digits out of a phone
number where the area code is optional. I have a feeling that there
is backtracking involved but I am not sure. Anyone have any ideas?
This is what I have so far - it works for 10 digits not 7.
$phone = '123-123-1234';
$phone = '123-1234';
($area_cd,$prefix,$extension) = $phone =~ /(?<=(\d{3}) \-) (\d{3}) \-
(\d{4}) /x;
number where the area code is optional. I have a feeling that there
is backtracking involved but I am not sure. Anyone have any ideas?
This is what I have so far - it works for 10 digits not 7.
$phone = '123-123-1234';
$phone = '123-1234';
($area_cd,$prefix,$extension) = $phone =~ /(?<=(\d{3}) \-) (\d{3}) \-
(\d{4}) /x;