You do indeed have a misunderstanding here. What the tool you're using does is find each matching group, which is more like this script instead:
Pattern urlPattern = Pattern.compile('http.*\\S');String input = 'Test bla bla bla \r http://test.xxxx.com/labs/test/files/unrelateddoc.pdf';Matcher m = urlPattern.matcher(input);while (m.find()) system.debug(m.group());