js从字符串中提取url
时间:2021-02-26 13:00:13
收藏:0
阅读:0
1 function httpString(s) { 2 var reg = /(https?|http|ftp|file):\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/g; 3 s = s.match(reg); 4 return (s) 5 }
评论(0)