in reply to phone number regex

Its Ugly But It Works(tm)
#!/usr/bin/perl -w while (<DATA>) { $num = join "-", split /\D+/; $num =~ s/^-//; print "$num\n"; } __DATA__ (01)1234 5678 (01) 1234 5678 01-1234-5678 01 1234 5678 01 234 4567
Updated
Not so ugly now...