views:

549

answers:

1

Hello. preg_replace ("/(\p{P})/", ' ', $str) removes apostrophes, and it should not. Please help

+3  A: 

Try this:

/\p{P}(?<!')/

The additional look-behind assertion is to ensure that the punctuation character is not an apostrophe.

Gumbo