JAVA 正则问题
Java code:
String compile="<.+?>";
String str="<a href='asdasd'>hahah</a>";
Pattern p = Pattern.compile(compile);
Matcher m = p.matcher(str);
while(m.find()){
//if(m.matches())
System.out.println(m.group());
}
这是把正则匹配的东西输出
我要把正则匹配的东西过滤掉,该怎么输出,
用分组啊
Java code:
String compile="<.+?>(.*?)</.+?>";
String str="<a href='asdasd'>hahah</a>";
Pattern p = Pattern.compile(compile);
Matcher m = p.matcher(str);
while(m.find()){
//if(m.matches())
System.out.println(m.group(1));
}
相关问答:
private static final String URL = "jdbc:oracle:thin:@localhost:1521:orcl";
private static final String USERNAME = "sys";
private static final String PASSWORD = "s ......
<html><head><title>[@title]</title>
<meta http-equiv=Content-Type content="text/html; charset=gb2312">
<script language='javascript'>
function diyCheck ......
怎么在控制台中输入类似下面的信息:
s1234 50
s1235 80
s1234 90
s1234 40
s1236 90
每当回车时 ......
我已经按照教程上配置tomcat的server.xml
<Context path = "/POS" docBase = "POS" debug = "5" reloadable = "true" crossContext = "true" workDir = &quo ......
<?xml version="1.0" encoding="utf-8" ?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical&q ......