I'm developing web-app with asp.net+js and stuck on regexp which works like a charm small test but absolutely doesn't works as expected in app.
Here's link to fiddle http://jsfiddle.net/#&togetherjs=sSzwzBe62Q. Here's the example words to try: слово, Слово, Пример. (word, Word, Example - russian).
Code should delete any word except the first one from inputs in left column. It works for latin but doesn't work for cyrillic. Any suggestions?
Perfectly working short example:
var rx = /[\wА-Яа-яЁё]+/;
var text = "Слово Word";
document.body.innerHTML = rx.exec(text);
Try to specify the ranges as unicode ranges.
I'm not very familiar with cyrillic, so I'm going to base my answer on http://en.wikipedia.org/wiki/Cyrillic_script_in_Unicode: