Ok, so I figured it out. The only issue was, my regex had to be
".*href=\"([^\"]*?)\".*"
Which then made the code
private String regex = ".*href=\"([^\"]*?)\".*";
private Pattern p = Pattern.compile(regex);
Matcher m = p.matcher(result);
if (m.matches()) {
String urlStr = m.group(1);
links.add(urlStr);
}
So that was my issue with the regex, I had to use the '?' to not be greedy I guess!