in reply to Trim Phone Numbers

perl -lnpe 's/.*(?=\d{3}-?\d{4}$)/*/'

or another interpretation of your question:

perl -lnpe 's/(\d\d-?)(\d{3}-?)(?=\d{3}-?\d{4}$)/$1=~tr!0-9!*!;$2=~tr!0-9!*!;$1.$2/e

@_=qw; Just another Perl hacker,; ;$_=q=print "@_"= and eval;