It depends a lot on the language (and the regex engine) you use.
In Perl, \w matches all characters of a word, regardless of language or alphabet, and something like /\b(\w+)\b/ will (possibly) match Spanish words, as well as English words or Russian words.
In languages using PCRE, \w (and therefore possibly \b ) do NOT match Unicode characters. You will probably need to create your own set. I suggest something like [\wáéíóúñ] (matches all word characters as well as highlighted characters), and the PCRE library needs to be pre-built with Unicode support before it even works.
If you use something else, good luck. Some regex engines do not even support Unicode.
Chris lutz
source share