您的位置:程序门 -> java -> 架构、设计



java正则表达式,太难了,谁帮我解决一下这个问题


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


java正则表达式,太难了,谁帮我解决一下这个问题
发表于:2008-01-08 13:13:01 楼主
html code
<body onload="init();"> <div id="temp" style=""> ####postlist?modelclassid=3&deptid=1&current_page=1&page_rows=1&forum_id=5#### ####postlist?modelclassid=3&deptid=2&current_page=1&page_rows=2&forum_id=4#### ####postlist?modelclassid=3&deptid=3&current_page=1&page_rows=3&forum_id=4#### ####postlist?modelclassid=3&deptid=4&current_page=1&page_rows=4&forum_id=4#### ####postlist?modelclassid=3&deptid=5&current_page=1&page_rows=5&forum_id=45147#### </div></body>


以上是我在网页中的一段代码,这个网页是用servlet从html文件中读取的,用正则表达式匹配“####postlist?modelclassid=3&deptid=1&current_page=1&page_rows=1&forum_id=5####”这个字符串,应该匹配出5个字符串,
这是我用的正则表达式“(####\\w+\\?(\\w+=\\w+&?)+####)”,怎么样不用循环,一次匹配出这5个字符串啊


快速检索

最新资讯
热门点击