$string = "a:b::c d"; @fields = split(/:|::|\s+/, $string); print "Got '$_'\n" for @fields; __DATA__ Got 'a' Got 'b' Got '' Got 'c' Got 'd'