📅  最后修改于: 2022-03-11 15:03:12.977000             🧑  作者: Mango
function URLReplacer(str){
let match = str.match(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig);
let final=str;
match.map(url=>{
final=final.replace(url,""+url+"")
})
return final;
}