I’ve modified this code several times. Now it starts matching at the FIRST instance and considers matcher.group(1) to be the entire rest of file from that match on…
IE instead of matching just :
[url]http://www.yahoo.com
It matches
http://www.yahoo.com”>Click here to go to yahoo.</a><br> —- AND ON
[code]
public void ProcessURL(String Info) {
if (Info == null) {
System.exit(1);
}
System.out.println(“Processing page for URLs…”);
Pattern url_pat = Pattern.compile(“.*href=”(.+)”.*”);
Matcher matcher = url_pat.matcher( Info );
if( matcher.find()) {
//System.out.println(“Total Matches: ” + matcher.matches());
String ftest = null;
for (int i = 1;i <= matcher.groupCount();i++) {
System.out.println(“Matched: (” + matcher.group(0) + “)”);
}
} else {
System.out.println(“No matches found.”);
}
System.out.println(“Done processing page for URLs.”);
}