my $str="1:2:3:4:590"; my ($a,$b)=split(/:([^:]+)$/, $str); print "a=$a\nb=$b\n";