let str = '数字顺背:#&#FA9520@@【21854】#&'
function dealwith(str){
let res = str.replace(/#&(.+?)#&/g, function ($1){
console.log($1,"$1");
let [color, text] = $1.replace(/#&/g,'').split('@@');
console.log(color, text);
return `<span style={{color:${color}}}>${text}</span>`
})
console.log(res,"res")
return res
}
document.write(dealwith(str))