Raining :
Paul Lemarchand :
This is because the character "close bracket" ]
is not a regular expression unless there was a bracket opened [
before. Therefore it is redundant to escape it \\]
, since Java is smart enough to know we are searching for the character itself in that case.
You can read the documentation for more informations on contexts where characters are percieved as regular-expressions.