Hi,
I am trying to match phone numbers, and want only having format xxx-xxxx.
Here is what i have written so far :
sub OfficePhoneNumber
{
my @numbers = @_;
my $number;
my @results;
foreach $number (@numbers)
{
if ($number =~ m/(^\d{3}-\d{4}$)/)
{
push @results, $number;
}
}
return @results;
}
&OfficePhoneNumber "554-321,+1 302-342-2323";
Please suggest on this.
Thanks, John