不知道具体的需求,参考一下吧
String test = "test1<a test2> test3 </a>test4";
Pattern p2 = Pattern.compile("<a .*.> .*. </a>");

System.out.println(p2.matcher(test).find());
System.out.println(p2.split(test)[0]);
System.out.println(p2.matcher(test));


String url = "www.sina.com.cn";
Pattern p3 = Pattern.compile("\\.");
System.out.println(p3.split(url)[1]);