超好用
public static void main(String[] args) {
String regex = "^(https?)://((?:[0-9]{1,3}\\.){3}[0-9]{1,3}|localhost)(?::\\d+)?";
String url = "https://192.168.0.103:8080/profile/wallhaven-gp8553_20240517150546A002.jpg";
String result = url.replaceFirst(regex, "");
System.out.println(result);
}