in reply to RE: split unless escaped
in thread split unless escaped

The problem is that then you lose any trailing double-backslashes, which are correctly kept in the OP method. For example, try it with the string 'a=1&b=2\&3\\&c=4'.