Your code is matching against "[\w]", which is a character class containing
word characters. It's equivalent to [a-zA-Z_0-9].
When you say you want to match special charters too, I assume you mean all characters but white space. If so, this can be done with the following character class: "[\S]".
Note that is a capital letter 'S'.
Edit to add: that character class is equivalent to [^s] (lower case 's') which is arguably clearer, if any regular expression can ever be said to be clear.
The Oracle tutorial will explain more:
http://docs.oracle.com/javase/tutorial/essential/regex/index.html