标签:
[\s|\S]* 匹配任意字符
.* 不能匹配\n
Pattern pattern = Pattern.compile("\\[[\\s|\\S]*\\]");
Matcher m = pattern.matcher("ccc([id:111,name:zhangsan])");
if(m.find()) {
System.out.println(m.group());//[id:111,name:zhangsan]
}
标签:
原文地址:http://my.oschina.net/sniperLi/blog/528983