I need a regex that also matches Chinese, Greek, Russian, ... letters. What I basically want to do is remove punctuation and numbers.
Until now I removed punctuation and numbers "manually" but that does not seem to be very consistent.
Another thing I have tried is
/[\p{L}]/
but that is not supported by Mozilla (I use this in a Firefox extension).
Have you given XRegExp and the Unicode plugin a try/look?
<script src="xregexp.js"></script>
<script src="xregexp-unicode.js"></script>
<script>
var unicodeWord = XRegExp("^\\p{L}+$");
alert(unicodeWord.test("Ниндзя")); // -> true
</script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With