展开全部
代码如下,62616964757a686964616fe58685e5aeb931333332613738供参考public class Test {
public static void main(String[] args) throws Exception {
String str = "adsf注册 成功!!";
System.out.println(replaceFlag(str));
}
private static String replaceFlag(String str) {
String rval = str;
// 替换标签
String tagRegex = "^<.>]*>(.[^$";
if (rval.matches(tagRegex)) {
rval = rval.replaceAll(tagRegex, "$1");
}
// 替换引号
String quotRegex = "\"(.*)\"";
if (rval.matches(quotRegex)) {
rval = rval.replaceAll(quotRegex, "$1");
}
return rval;
}
}