beginner regular expressions( java) : s = s.replaceAll("\\\s+$" , "");
I am still a beginner in java but as far as I know to use regular expressions I have to write it in [ ] so why this works and how the Jvm knows it is regular expressions and not just some string