📌  相关文章
📜  javascript 链接检测器 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:12.977000             🧑  作者: Mango

代码示例1
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;
      }