i have code below which finds and wraps those words in a span element, but only them.
i would like to wrap a whole word if it inludes those words. for example: GSHAA or GSH112
my code:
var words = ["GSHT","GSH","SHV"];
$('.list-icons a').html(function(_,html) {
var reg = new RegExp('('+words.join('|')+')','gi');
return html.replace(reg, '<span class="wrap">$1</span>', html)
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…