1 java后台 2 String str=hello你好吗,我很好 thank you????噼安胖胖� � � � "; 3 4 String reg = "[ud83cudc00-ud83cudfff]|[ud83dudc00-ud83dudfff]|[u2600-u27ff]"; 5 Pattern pat = Pattern.compile(reg); 6 Matcher mat = pat.matcher(str); 7 String s=""; 8 while (mat.find()){ 9 //你的代码 10 s+=mat.group(); 11 } 12 System.out.println(s);//保留符合条件的数据
去掉所有html标签
data.replace(/<[^>]+>/g,"")
//去掉所有undefined显示
function ifnull(elem){
return elem.replace(/undefined/g,"");
}
/g表示全局匹配