fork download
  1. import java.util.regex.Matcher;
  2. import java.util.regex.Pattern;
  3.  
  4. class Main
  5. {
  6. public static void main (String[] args) throws java.lang.Exception
  7. {
  8. String s = "{'Im': {url:'\\/az\\/hprichbg\\/rb\\/?*<>WhiteTippedRose_ROW10477559674_1366x768.jpg', hash:'674'}";
  9.  
  10. Pattern p = Pattern.compile("[^\\/:*?\"<>|]+\\.jpg");
  11. Matcher m = p.matcher(s);
  12. if (m.find()) {
  13. String match = m.group();
  14. System.out.println(match);
  15. }
  16. }
  17. }
Success #stdin #stdout 0.06s 380160KB
stdin
Standard input is empty
stdout
WhiteTippedRose_ROW10477559674_1366x768.jpg