Here you can find the source of parseLastfmUrl(String url)
public static String parseLastfmUrl(String url)
//package com.java2s; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; public class Main { public static String parseLastfmUrl(String url) { if (url == null) { return null; }/* w w w .java 2 s.c o m*/ String parsed = url.replaceAll(".*?www.last.fm/.*?/", ""); parsed = parsed.replaceAll("/.*", ""); String decoded = null; try { decoded = URLDecoder.decode(parsed, "UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return decoded; } }