trying to take a url and turn it into a file name by grabbing the last bit of the string that doesnt have any characters that arent allowed in file names, but this keeps returning the same sting over and over again "://"
System.out.println("\n" + filename + "\n"); Pattern pattern = Pattern.compile("[\\\\/:\\*\\?\\\"<>\\|][^[\\\\/:\\*\\?\\\"<>\\|]]+"); Matcher matcher = pattern.matcher(filename[i]); while (matcher.find()) { filename = matcher.group(); System.out.println("\n" + filename + "\n"); }