HTMLJS 文字高亮 2023年04月05日 const regex = new RegExp(searchContent, "gi"); return text.replace(regex,'<span style="color:#286CFB;">$&</span>');