replaceReg: function(str) { let regx = /(https|http|ftp|file):\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/g; let chineseReg = /[\u4e00-\u9fa5]+/g; if (chineseReg.test(str)) { // 是包括汉字字母 str = str.match(regx); } return str ? str.toString() : ''; }