\ is a special escape character in both the Java string and the regex engine. To pass the literal \ to the regex engine, you must have \\\\ in the Java string. So try:
s.replaceAll("\\\\Q", "").replaceAll("\\\\E", "")
An alternative and simpler way would be to use the replace method, which takes a string, not a regular expression:
s.replace("\\Q", "").replace("\\E", "")
source share