79272034

Date: 2024-12-11 14:22:23
Score: 1.5
Natty:
Report link

You are facing this issue because your regular expression is not correct.

That's because the \b word boundary works well with Latin string but struggles with RTL and Unicode character.

Try to replace it with g for global and u for Unicode chars

const regex = new RegExp(`(${highlightWordsArray.join("|")})`, "gu")

You can check this article if you wanna discover more

Reasons:
  • Blacklisted phrase (1): this article
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Dallas