0

我想替换特定序列的梵文 Unicode 字符。

$re = '/(कर(?![ािीुूृॄॅेैॉोौ्ऱ्]))/m';
$str = 'समर साकाकरुन भरुन करमरकर';
$subst = '****';
$result = preg_replace($re, $subst, $str);
echo "The result of the substitution is ".$result;

请注意,如果这些 ([ािीुूृॄॅेैॉोौ्ऱ्) 字符不遵循此 (कर) 模式,则每次出现 कर 的替换都是 ****。这在 https://regex101.com/r/WRc04s/1 上可以正常工作,但在我的 WAMP 或 LAMP 设置上不能正常工作。请注意,使用英语(拉丁语)字符集可以按预期工作。可能是什么问题?

4

0 回答 0