java后台
String str=hello你好吗,我很好 thank you????噼安胖胖 "; String reg = "[\ud83c\udc00-\ud83c\udfff]|[\ud83d\udc00-\ud83d\udfff]|[\u2600-\u27ff]";
Pattern pat = Pattern.compile(reg);
Matcher mat = pat.matcher(str);
String s="";
while (mat.find()){
//你的代码
s+=mat.group();
}
System.out.println(s);//保留符合条件的数据
去掉所有html标签
data.replace(/<[^>]+>/g,"")
//去掉所有undefined显示
function ifnull(elem){
return elem.replace(/undefined/g,"");
}
/g表示全局匹配