This /[a-z]/i.test(s)
is a JS regex that checks the string s
for the presence of at least one alphabetic character.
That's great for English or Simplified English but I'd like to broaden it to match "letters" from all languages. What I'm actually trying to do is detect strings with words in them. Obviously things like Chinese aren't going to match [a-z].
Is there a reliable pan-language method to do this?
The question How can I use Unicode-aware regular expressions in JavaScript? mentions the \w symbol but the accepted response totally ignores this aspect and only covers how to enable Unicode support. It does not address the question of how to detect words.