\.
Most special characters can be escaped by preceding them with a back slash. (Which of course needs to be two slashes because Java treats the single one as its *own* escape.)
So, the pattern would be
"\\.\\s+"
I tend to escape all special characters at all times, just for the paranoia of it. Even when I don't have to.
For example, I'll tend to use
"[a-z\\[\\-]"
even though I know in my head that no backslashes are needed there. But guess what: Most of the time my patterns work first time. I'll take the extra typing in place of the extra debugging.
|