我现在有这样一个字符串
,我想把这个给替换成空字符串,但是:"x-msg://1/"里面的数字1是不确定的,也有可能是108,比如,求大神给写个正则表达式,public static void main(String[] args) {
String source = "first {test} is here,two {test2} is here!";
String find = "\u007B.*\u007D";
Pattern pattern = Pattern.compile(find);
Matcher matcher = pattern.matcher(source);
while(matcher.find()) {
System.out.println(matcher.group());
}
}
刚发现,那个字符串给隐藏了,在发一下“
”你的字符串是啥????
x-msg:\/\/\d+\/
x-msg://\d+/,数字使用\d+或[0-9]+
直接把数字部分改写为\d