It appears JS isn't so good at this (as noted here by @Rolice in the comments above). In most languages, you merely need to change the locale.
You may have to do something like this:
replace(/(^|[^\w\u0400-\u04FF])(\w+)([^\w\u0400-\u04FF]|$)/,
"$1<span>$2</span>$3");