Java tutorial
//package com.java2s; import android.text.TextUtils; import java.util.regex.Pattern; public class Main { private final static String MUC_NAME_PATTEN = "^[^@<>$!%^*&]+$"; public static boolean isMucNameContentLegal(String mucName) { boolean bret = false; if (TextUtils.isEmpty(mucName)) { return bret; } Pattern p = Pattern.compile(MUC_NAME_PATTEN); bret = p.matcher(mucName).matches(); return bret; } }