import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class aa {

    public static void main(String[] args) {
        String htmlStr = "<img src='http://1231//1231/123/123.jpg' alt='图片'>";
        Matcher m = Pattern.compile("src=\"?(.*?)(\"|>|\\s+)").matcher(htmlStr);
        String filePath = "";
        while(m.find())
        {    
            filePath = m.group(1);
        }
        System.out.println(filePath);
        System.out.println(filePath.substring(filePath.lastIndexOf("/")+1,filePath.length()-1));
    }

}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-06
  • 2022-12-23
  • 2022-12-23
  • 2022-02-05
  • 2021-10-19
  • 2021-09-18
相关资源
相似解决方案