微信过滤表情包

public String filterEmoji(String source) {
    if (source == null) {
        return source;
    }
    Pattern emoji = Pattern.compile("[\ud83c\udc00-\ud83c\udfff]|[\ud83d\udc00-\ud83d\udfff]|[\u2600-\u27ff]",
            Pattern.UNICODE_CASE | Pattern.CASE_INSENSITIVE);
    Matcher emojiMatcher = emoji.matcher(source);
    if (emojiMatcher.find()) {
        source = emojiMatcher.replaceAll("*");
        return source;
    }
    return source;
}

  

微信过滤表情包

上一篇:微信小程序测试点


下一篇:.NET框架设计(高级框架架构模式)—钝化程序、逻辑冻结、冻结程序的延续、瞬间转移