But I have a problem because faces are appearing where you don't want them like in links:
http
I want the smiley to only display if it is NOT next to a letter or number.
What would the regex be?
Moderator: General Moderators
Code: Select all
$post = '.:)';
$post = preg_replace('#\.:\)#', '<img src="smile.png" />', $post);Code: Select all
$post = '@:)';
$post = preg_replace('#\W:\)\W#', '<img src="smile.png" />', $post);Code: Select all
(?!://):/Code: Select all
(?<!http):/