I am creating an application and I'm making command for emoticons.
When you type
/happy /happy /happy happy
I mean you don't even need a regex for this, but if you wanted to use one, it's as simple as:
$string = preg_replace('@/happy\b@i', ':)', $string);
\b is a "word boundary" which would prevent "
/happyer" from turning into