js 正则 把一段文字里面的数字加上前后标签 让文字加粗放大
getlmgu_msg(value){ var reg = /[0-9]+(\.?[0-9]+)?\%?/g; let str = value;//'恭喜您再获得3999上市股票'; str = str.replace(reg,"<span style='font-size: 48upx;font-weight: bold;'> $& </span>"); console.log(str) return str; }
getlmgu_msg(value){ var reg = /[0-9]+(\.?[0-9]+)?\%?/g; let str = value;//'恭喜您再获得3999上市股票'; str = str.replace(reg,"<span style='font-size: 48upx;font-weight: bold;'> $& </span>"); console.log(str) return str; }