in reply to split unless escaped

if you use (?: ) (do not make backreference) you can go with out the second line. @a = split /(?<!\\)(?:\\\\)*&/, "a=1&b=2\\&3&c=4"; print join("|",@a)."\n"; @b = split /(?<!\\)(\\\\)*&/, "a=1&b=2\\&3&c=4"; $b$_ .= splice @b, $_ + 1, 1 for (0..($#b/2)); print join("|",@b)."\n";