function HighLight() {
const keyword = '00';
const str = '12300998800123'
const matchText = new RegExp(keyword, 'ig');
const string = str.replace(matchText, `<mark style="color: #ff4b01">${ keyword }</mark>`);
return <div dangerouslySetInnerHTML={{__html: string}} />;
}
RegExp.$1
RegExp.$1
https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/RegExp/n
.replace(reg,`<mark class='highlight'>$1</mark>`);