This is a \"what the heck is going on here\" question. I don\'t actually need a solution.
I had to replace all single backslashes in a String with double backslashe
It's easier if you use replace("\\","\\\\") (String.replace takes literal strings and is more efficient when it's all literal)
replace("\\","\\\\")
or you can ensure correctness through the Pattern.quote and Matcher.quoteReplacement functions
Pattern.quote
Matcher.quoteReplacement