I hope this is an easy question. I'm still extremely new to regex.
I'm building a php/mysql chatroom. I would like to be able to have emoticons. I also want to be able to add emoticons easily. So here's what I would like to happen:
User types: hey everyone vissmile hows everything going? visfronw
I need an expression that finds all words starting with vis, and returns the entire word. Then I can take that word, compare it to a database. If the word is in the database, I can replace word with the appropriate img tag. If the word isn't found (i.e. visfronw because frown is mispelled) it doesn't to any replacing. It just leaves visfronw in the text line.
And I need to be able to make sure replacing vissmile won't affect vissmiles.
I have looked on the internet, but perhaps I'm not looking for the right thing because I haven't found an answer.
-YungBlood