标签:style blog class code java color
1 String pattern = "\\{[^\\}]+\\}"; 2 // 创建 Pattern 对象 3 Pattern r = Pattern.compile(pattern); 4 5 String str = "您好,{a||b||c},这里是{d||e||f}"; 6 // 现在创建 matcher 对象 7 Matcher m = r.matcher(str); 8 while (m.find()) { 9 System.out.println(m.group()); 10 }
打印为:
java正则表达式:查找所有{XXX},布布扣,bubuko.com
标签:style blog class code java color
原文地址:http://www.cnblogs.com/skyeyh/p/3708858.html