String content = “testContent”;
String regex="^[a-zA-Z0-9\u4E00-\u9FA5]+$";
Pattern pattern = Pattern.compile(regex);
Matcher match=pattern.matcher(content);
boolean b=match.matches();
if(b)
{
Toast.makeText(this, "success...", Toast.LENGTH_SHORT).show();
}
else
{
Toast.makeText(this, "fail...", Toast.LENGTH_SHORT).show();
}

posted on 2014-08-14 16:20  Snow〃冰激凌  阅读(31112)  评论(0编辑  收藏  举报