i'm using the following function to highlight certain word and it works fine in english
function highlight(str,toBeHighlightedWord)
{
toBeHighlightedWord="(\\b"+ toBeHighlightedWord.replace(/([{}()[\]\\.?*+^$|=!:~-])/g, "\\$1")+ "\\b)";
var r = new RegExp(toBeHighlightedWord,"igm");
str = str.replace(/(>[^<]+<)/igm,function(a){
return a.replace(r,"<span color='red' class='hl'>$1</span>");
});
return str;
}
but it dose not for Arabic text
so how to modify the regex to match Arabic words also Arabic words with tashkel, where tashkel is a characters added between the original characters example: "محمد" this without tashkel "مُحَمَّدُ" with tashkel the tashkel the decoration of the word and these little marks are characters