It works fine. Did you read the documentation? The string is converted to a regular expression.
.
is the special character matching all input characters.
As with any regular expression special character, you escape with a \
. You need an additional \
for the Java string escape.