in reply to Easy Split

$ perl -le 'print join "\n", map {s/\\://g;$_} "aa:b\\:b\\::\\:c\\:\\: +c"=~m!(?>\\.|[^:])+!gs' aa bb cc

$ perl -le 'print join "\n", map {s/\\://g;$_} "111111111:22222\\:2222 +:333333333:4444444"=~m!(?>\\.|[^:])+!gs' 111111111 222222222 333333333 4444444

Torsten

Replies are listed 'Best First'.
Re^2: Easy Split
by ikegami (Patriarch) on Jul 03, 2009 at 16:52 UTC
    Why are you removing the colons?
    map {s/\\://g;$_}
    should be
    map { (my $s = $_) =~ s/\\(.)/$1/sg; $s }

    Update: hum... The OP did show a lack of colons in the desired output. If that's truly what he wants,

    map {s/\\://g;$_}
    should be
    map { my $s = $_; $s =~ s/\\(.)/$1/sg; $s =~ s/://g; $s }