Regular expression in android for accept only English language
I try
Pattern.matches(开发者_开发百科"[A-Za-z]+"
and it still can accept other languages such as ฟฟฟฟabc or abcฟฟฟ
what should I do?
^[A-Za-z]+$
Use start-of-string and end-of-string anchors.
If you don't, the regex does not have to match the entire string, but this is what you seem to want.
Are you working in UTF-8? Have you tried the \uFFFF, where FFFF is the hex representation of the Unicode character.
精彩评论