
下 面一共列出了105个QQ表情,每个表情都给出了与之相对应的文字代码与符号代码:
向公众帐号发送一个QQ表情,在后台程序中接收到的是QQ表情的符号代码。
/** * 判断是否是QQ表情 * * @param content * @return */public static boolean isQqFace(String content) {boolean result = false;// 判断QQ表情的正则表达式String qqfaceRegex = '/::\)|/::~|/::B|/::\||/:8-\)|/::<| :$|/::x|/::z|/::'\(|/::-\||/::@|/::p|/::d|/::o|/::\(|/::\+|/:--b|/::q|/::t|/:,@p|/:,@-d|/::d|/:,@o|/::g|/:\|-\)|/::!|/::l|/::="">|/::,@|/:,@f|/::-S|/:\?|/:,@x|/:,@@|/::8|/:,@!|/:!!!|/:xx|/:bye|/:wipe|/:dig|/:handclap|/:&-\(|/:B-\)|/:<@| @="">|/::-O|/:>-\||/:P-\(|/::'\||/:X-\)|/::\*|/:@x|/:8\*|/:pd|/:|/:beer|/:basketb|/:oo|/:coffee|/:eat|/:pig|/:rose|/:fade|/:showlove|/:heart|/:break|/:cake|/:li|/:bome|/:kn|/:footb|/:ladybug|/:shit|/:moon|/:sun|/:gift|/:hug|/:strong|/:weak|/:share|/:v|/:@\)|/:jj|/:@@|/:bad|/:lvu|/:no|/:ok|/:love|/:|/:jump|/:shake|/:|/:circle|/:kotow|/:turn|/:skip|/:oY|/:#-0|/:hiphot|/:kiss|/:<&| &="">';Pattern p = Pattern.compile(qqfaceRegex);Matcher m = p.matcher(content);if (m.matches()) {result = true;}return result;}