Why is this preg_replace not working?
FYI, I have the PHP script set to UTF8 Without BOM and I have the function here set to remove all matches of the pattern (instead of what I will actually do, which is remove all non-matches) because that is easier for testing. Note also that the ā
character is not in my regex, so this should be the only character left behind.
$string='The Story of Jewād';
echo preg_replace('@([!"#$&’\(\)\*\+,\-\./0123456789:;<=>\?ABCDEFGHIJKLMNOPQRSTUVWXYZ\[\\\]\^_‘abcdefghijklmnopqrstuvwxyz\{\|\}~¡¢£⁄¥ƒ§¤“«‹›fifl–†‡·¶•‚„”»…‰¿`´ˆ˜¯˘˙¨˚¸˝˛ˇ—ƪŁØŒºæıłøœß÷¾¼¹×®Þ¦Ð½−çð±Çþ©¬²³™°µ ÁÂÄÀÅÃÉÊËÈÍÎÏÌÑÓÔÖÒÕŠÚÛÜÙÝŸŽáâäàåãéêëèíîïìñóôöòõšúûüùýÿž€\'])@u','',$string);
The result I get is $string unchanged. Why would this be?