android - extract String between last slash and question mark -
i want extract string between last slash , question mark using regex
string path="http://keting.amazonaws.com/media123/mediaattachments/000/000/004/original/shoes_tvc_2013.mp4?1470248308"
i need "shoes_tvc_2013.mp4" string.
pattern pattern = pattern.compile("need here"); matcher matcher = pattern.matcher(url); if (matcher.find()) { system.out.println(matcher.group(1)); //prints region/country } else { system.out.println("match not found"); }
.*\/(.*)\?
should trick. see here more.
Comments
Post a Comment