我可以在 JS 中匹配并突出显示这个希伯来字母:
var myText = $('#text').html();
var myHilite = myText.replace(/(\u05D0+)/g,"<span class='highlight'>$1</span>");
$('#text').html(myHilite);
但无法在单词边界突出显示包含该字母的单词:
/(\u05D0)\b/g
我知道 JS不擅长使用 Unicode 的正则表达式(首选服务器端),但我也知道我不擅长正则表达式。这是 JS 的限制还是我的语法错误?