Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
preg_replace ("/(\p{P})/", ' ', $str)删除撇号,它不应该。请帮忙
preg_replace ("/(\p{P})/", ' ', $str)
试试这个:
/\p{P}(?<!')/
附加的后视断言是为了确保标点字符不是撇号。