1. 程式人生 > >java 正則表示式 提取字串

java 正則表示式 提取字串

publicstaticvoid 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()); } }