過濾網址:json
var match = /((https|http|ftp|rtsp|mms)?:\/\/)[^\s\u4e00-\u9fa5]+/ig; /*'<a href="#">請點我</a>'*/ var changeContent = json.content.replace(match ,function (value) { return '<a href="'+value+'">請點我</a>'; });io