c:\@Work\Perl\monks>perl -wMstrict -le "use 5.010; ;; my $s = 'Sent 1 12 to 1402, 222-2222, 1304, 555.555.5555 and 501, 666 666 6666 & 6789'; print qq{'$s'}; ;; my $sep = qr{ [-. ] }xms; my $pn = qr{ \d{3} ($sep) (?: \d{3} \1)? \d{4} }xms; my $an = qr{ \d{3,4} }xms; ;; $s =~ s{ (?| $pn (*SKIP)(*F) | (?$1}xmsg; print qq{'$s'}; " 'Sent 1 12 to 1402, 222-2222, 1304, 555.555.5555 and 501, 666 666 6666 & 6789' 'Sent 1 12 to 1402, 222-2222, 1304, 555.555.5555 and 501, 666 666 6666 & 6789'