Regex and escaped and unescaped delimiter
问题 question related to this I have a string a\;b\\;c;d which in Java looks like String s = "a\\;b\\\\;c;d" I need to split it by semicolon with following rules: If semicolon is preceded by backslash, it should not be treated as separator (between a and b ). If backslash itself is escaped and therefore does not escape itself semicolon, that semicolon should be separator (between b and c ). So semicolon should be treated as separator if there is either zero or even number of backslashes before it.