It seems that the regex escaping works different in different versions of Java.
In Java openjdk 16.0.1 the compilation works fine
In Java openjdk 11.0.11 this compilation error is thrown:
test.java:15: error: illegal escape character
if (variable.matches("\s*")){
I know, that I'm generally on the safe side with \\. My question:
Since which version changed this behavior? And why works this?