perl -le "$str='a\\:b:c'; my (undef,$x,$y)=split /((?:[^:\\]+|\\.)*):/s,$str,2; print for $x,$y" a\:b c