I need to check if a string contains chinese characters.
After searching i found that i have to look with the regex on this pattern \u31C0-\u31EF
,
But i don't manage to get the regex work.
Anyone experienced with this situation ? is the regex correct ?
"[\u31C0-\u31EF]"
will indeed match any character whose code point is in the range0x31C0
to0x31EF
. You need the square brackets. I have no idea whether the actual numbers are correct; there are only 48 characters in this range, and I thought CJK had a lot more than that, but what do I know? – ajb