标签: php preg-replace
我尝试将preg_replace替换为
preg_replace
preg_replace('/(word)[\W|\.]/', 'NEW', $str);
它取代了(word)[\W|\.],而不是匹配和替换世界。如何调整模式以仅替换word?
(word)[\W|\.]
word