验证url的正则
一、
'/@(?i)\b((?:[a-z][\w-]+:(?:/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:\'".,<>?«»“”‘’]))@/'
二、
/https?:\/\/([\w-]+\.)+[\w-]+(\/[\w- ./?%&=]*)?/ig
function checkurl(val){
return val.replace(/https?:\/\/([\w-]+\.)+[\w-]+(\/[\w- ./?%&=]*)?/ig,function(m){return '<a href="'+m+'" style="color: #0BD0CD; font-size: 14px;">'+m+'</a>';})
}