my $text = "1..., some words, Dec 13, 2001"; if ($text =~ m/^\1/) { $text =~ m/(.*$)/; print "${1},P"; }