According to the documentation of WordCharacter
:
WordCharacter
matches any character for which eitherLetterQ
orDigitQ
yields True.
However, the results of the following code seem not compatible with the doc:
StringMatchQ[#, WordCharacter] & /@ {"a", "1", ".", " ", "中", "あ"}
LetterQ[#] || DigitQ[#] & /@ {"a", "1", ".", " ", "中", "あ"}
{True, True, False, False, True, True}
{True, True, False, False, False, False}
I suppose there is a special rule to handle CJK characters, so it's the doc which should be corrected, am I right?
(As the motivation of this "discovery", I was trying to match any characters not belong to CJK.)
WordCharacter
does not not match any character which neitherLetterQ
norDigitQ
matches. $\endgroup$LetterQ
is only usable for the Latin and Greek alphabets, and even then only the letters that exist in English and modern Greek.StringMatchQ
relies on the PCRE library, so it considersWordCharacter
whatever PCRE does. This extends at least to some other alphabets/character types. $\endgroup$