pattern pattern = pattern.compile("@.+?(:|\\s)"); matcher matcher = pattern.matcher("@正则表达式:hello world,@正则表达式 helloworld"); system.out.println(matcher.replaceall("java"));
正则匹配@开始空格或结束
最新推荐文章于 2023-06-09 10:39:19 发布
pattern pattern = pattern.compile("@.+?(:|\\s)"); matcher matcher = pattern.matcher("@正则表达式:hello world,@正则表达式 helloworld"); system.out.println(matcher.replaceall("java"));

被折叠的 条评论
为什么被折叠?
