splitThe class function Stringwill not help you in this case, because it discards the delimiter and this is not what we want here. you need to make a pattern that looks behind. Syntax Appearance:
(?<=X)Y
Which identifies anyone Ythat is preceded X.
So, in this case you will need this template:
(?<=30/).*
, , :
String input = "http://xxx/Content/SiteFiles/30/32531a5d-b0b1-4a8b-9029-b48f0eb40a34/05%20%20LEISURE.mp3?&mydownloads=true";
Matcher matcher = Pattern.compile("(?<=30/).*").matcher(input);
matcher.find();
System.out.println(matcher.group());