How about having each part of the phone number as a seperate input? then a simple variation of ^\d{3}$ will do for each part. Definately not an elegant approach, but it is a perfectly valid and simple solution.
Here's a dirty solution for you...
Code:
$num = "aldkj654658djkd5465";
$num =~ s,\D,,g;
$num = substr($num, 0, 10);
if ($num !~ /^(\d{7}|\d{10})$/) {
print "your phone number appears invalid";
}
it strips out any non-digit, then takes the first 10 digits from that. Then it tests that there are EXACTLY 7 or 10 digits. Of course the test is brain-dead when it comes to telling the difference between a fake phone number (like 000-0000) and a real one.
Philip
------------------
Limecat is not pleased.