Regex match Arabic keyword
<p>I have simple regex which founds some word in text:</p>

<pre><code>var patern = new RegExp("\bsomething\b", "gi");
</code></pre>

<p>This match word in text with spaces or punctuation around.</p>

<p>So it match:</p>

<pre><code>I have something.
</code></pre>

<p>But doesn't match:</p>

<pre><code>I havesomething.
</code></pre>

<p>what is fine and exactly what I need.</p>

<p>But I have issue with for example Arabic language. If I have regex:</p>

<pre><code>var patern = new RegExp("\bرياضة\b", "gi");
</code></pre>

<p>and text:</p>

<pre><code>رياضة أنا أحب رياضتي وأنا سعيد حقا هنا لها حبي 
</code></pre>

<p>The keyword which I am looking for is at the end of the text.</p>

<p>But this doesn't work, it just doesn't find it.</p>

<p>It works if I remove <code>\b</code> from regex:</p>

<pre><code>var patern = new RegExp("رياضة", "gi");
</code></pre>

<p>But that is now what I want, because I don't want to find it if it's part of another word like in english example above:</p>

<pre><code> I havesomething.
</code></pre>

<p>So I really have low knowledge about regex and if anyone can help me to work this with english and languages like arabic.</p>