String s = "this is a test testabcd program."; Pattern p = Pattern.compile("test\\b"); //Pattern p = Pattern.compile("test"); //看看没有\\b结果是什么 Matcher m = p.matcher(s); while (m.find()) { System.out.println(m.group()); }
62,635
社区成员
307,269
社区内容
加载中
试试用AI创作助手写篇文章吧