Right now I am using this function for emoticons:
function emoticons($text) { $icons = array( \':)\' => \'
Regular expressions are slow for this if the text is big, as much as i like them, you should only insert an icon if it's surrounded by spaces, that way your users won't riot when trying to write urls.