正则表达式匹配注释/*xxx*/
String content ="/* xxx */";
String regex = "/\\*(?:(?!\\*/|/\\*).)*+(?:/\\*(?:(?!\\*/|/\\*).)*+\\*/(?:(?!\\*/|/\\*).)*+)*+.*?\\*/";
content.maches(regex) == true
发布时间: 2012-11-01 11:11:31 作者: rapoo
正则表达式匹配注释/*xxx*/
String content ="/* xxx */";
String regex = "/\\*(?:(?!\\*/|/\\*).)*+(?:/\\*(?:(?!\\*/|/\\*).)*+\\*/(?:(?!\\*/|/\\*).)*+)*+.*?\\*/";
content.maches(regex) == true