$time2 =~ s/^(\d{2})(\d{2})(\d{2})\.(\d{2}).*?$/$1:$2:$3.$4/; # ^ # add anchor point