1
var regexp = /(http:\/\/|https:\/\/)((\w|=|\?|\.|\/|\&|-)+)/g;
content = content.replace(regexp, function($url){
 return "<a href='" + $url + "' target='_blank'>" + $url + "</a>";
});
console.log(content);

silenceboy
1.1k 声望46 粉丝

coding for fun