摘要: var reg = /(http:\/\/|https:\/\/)((\w|=|\?|\.|\/|&|-)+)/g; if(str.indexOf('<a href=') 1){ // 过滤下a标签 str= str.replace(reg, "<a href='$1$2'>$1$2</a>"); 阅读全文