|more useful options|
Numbers only in a stringby powerhouse (Friar)
|on Sep 08, 2005 at 15:39 UTC||Need Help??|
powerhouse has asked for the wisdom of the Perl Monks concerning the following question:
I need to get the users input for tech support, I have a dialer that will call them back for the support, but the phone number can only be ten digits long. So first I want to get ONLY the numbers, then I can play with it, like if it is 11 digits in length, and the first digit is a 1 then I will have it drop off the one. My problem is that I cannot get it to work, it does not strip off anything.
Does this not work:
$phone =~ s/!(^\d+)//g;
I've searched a few sites, including this one, usually for the terms, "phone number only", "numbers only" "strip everything but numbers" and so forth, but found nothing.