Replace certain arabic words in text string using Javascript

You can build your own Unicode word boundaries: Left-hand (leading) word boundary pattern can be defined as a position that is not immediately preceded with letter + any potential diacritics or a digit or an underscore: (?<!\p{L}\p{M}*|[\p{N}_]) Right-hand (trailing) word boundary pattern can be defined as a position that is not immediately followed with a … Read more