$str = 'کس نے موسیٰ کے بارے میں سنا ہے؟';
$str = preg_replace('/(?<=\b)موسیٰ(?=\b)/u', 'Musa', $str);
$str = preg_replace('/(?<=\b)سنا(?=\b)/u', 'suna', $str);
echo $str;
This fails to replace موسیٰ. It should give کس نے Musa کے بارے میں suna ہے؟ but instead gives کس نے موسیٰ کے بارے میں suna ہے؟.
This is happening for all words that end with a ٰ, like تعالیٰ . It works for words where ٰ is in the middle of the word (no words begin with a ٰ). Does this mean that \b just doesn't work with ٰ? Is it a bug?