Java tutorial
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { public static ArrayList<String> getResultUrl(String html) { ArrayList<String> resultUrl = new ArrayList<String>(); String re = "<div class=\"sort_name_detail\"><a href=\"(.+?)\" target=\"_blank\" title=\"(.+?)\">"; Pattern pattern = Pattern.compile(re); Matcher matcher = pattern.matcher(html); while (matcher.find()) { resultUrl.add(matcher.group(1)); System.out.println(matcher.group(1)); } return resultUrl; } }