package shine;
import java.util.regex.*;
public class GetUrl {
public static void main(String[] args) {
String str = "<html>abc</html>";
Pattern P = Pattern.compile("<html>(.*?)</html>");
Matcher m = P.matcher(str);
boolean b = m.matches();
try{
System.out.println(m.group(1));
}catch (Exception e){
System.out.println("it is not regex success...");
}
}
}
java匹配字符串
最新推荐文章于 2021-11-07 15:21:38 发布