\w matches only Latin letters, decimal digits, and underscores (
\b matches the boundary the between a word character and and a non-word character.
To find all words in an input string using Latin or Cyrillic, you’d have to do something like this:
.match(/[\wа-я]+/ig); // where а is the Cyrillic а.
Or if you prefer:
Of course this will probably mean you need to tweak your code a little bit, since here it will match all words rather than word boundaries. Note that
[а-я] matches any letter in the ‘basic Cyrillic alphabet’ as described here. To match letters outside of this range, you can modify the character set as necessary to include those letters, e.g. to also match the Russian Ё/ё, use
Also note that your triple-bracket pattern can be simplified to: