Use /u when calling preg_match

This fixes problems with multi-byte characters not being recognized as words.

Fixes #2154

/cc @brendo