Java regex throwing exception for no match found when pattern found in line
问题 I am dying trying to figure out why a regex won't match. Any help is much appreciated. I'm going line by line of a web page (that works fine), but I need to pull out the links for each line. The application will check to see if there is a link in the line, but I need to actually pull out the URL. help? Pattern p = Pattern.compile("^.*href=\"([^\"]*)"); Matcher m = p.matcher(result); String urlStr = m.group(); links.add(urlStr); The error message I keep getting is this: Exception in thread