I\'m trying to create a regular expression to extract URLs from text documents using Java, but thus far I\'ve been unsuccessful. The two cases I\'m looking to capture are li
Pattern p = Pattern.compile("http://.*|www\\..*");
Matcher m = p.matcher("http://..."); // put here the line you want to check
if(m.matches()){
so something
}