my $str = '"hello, my name is Bob, my cell number is, 1234567890"'; $str =~ s/,[^,]*"$/"/; print "$str\n";