if ($_ =~ m/(\d+)\:(\d+) (\d+)\/(\d+)\/(\d+)/ ){ my $string = "(\d+)\:(\d+) (\d+)\/(\d+)\/(\d+)"; my $new = $string =~ s/ / /; print "new $new "; }