As Johnny Mopp mentioned in his comment, you are passing the literal \w
into the string, when you probably meant to pass in the expression \w
. Thus, you need to use \\w
to pass the expression.
In fact, in the header that you linked yourself, the examples all have \\w
in the strings.