#!/usr/bin/perl -w use strict; my $string = '111111111:22222\:2222:333333333:4444444'; $string =~ s/\\:/:/; #translate \: to just : #the "trick" and its all over now... chomp ($string); #don't worry about trailing \n my @strings = split (/:/,$string); foreach my $line (@strings) { print "$line\n"; } __END__ prints: 111111111 22222 2222 333333333 4444444