Check if emoji character [duplicate]

2019-06-08 21:18发布

This question already has an answer here:

I have a Java servlet which accepts text from mobile devices. I need to check each character and check if it is a normal text or if it is an emoji before I insert it into my database. The problem I am having is how do I detect if a character is emoji?

标签: java emoji
1条回答
三岁会撩人
2楼-- · 2019-06-08 21:51

ok simple example defined private string emoji regex.

 private final String regex = "([\\u20a0-\\u32ff\\ud83c\\udc00-\\ud83d\\udeff\\udbb9\\udce5-\\udbb9\\udcee])";

variable with test sentence

test = "josh stevens is the best                                                                     
查看更多
登录 后发表回答