var value = "https://www.baidu.com/20210922/95b22ab5034b2d0f.jpg";
const str = value.split("https://"); //https://進行分割,
const index = str[1].indexOf("/")+1; //indexOf 獲取第一個斜杠的索引,
console.log(str[1].substring(index)); //substring 截取,
//獲取前面的域名
var i = "https://www.baidu.com/20210922/95b22ab5034b2d0f.jpg";
console.log(i.match(/^(?:[^\/]|\/\/)*/));