What exactely do you need this for?
If it’s only to parse chat messages and display the emotes properly you actually don’t have to take of this at all as (when the proper CAP(ability) is enabled on the connection) the Twitch IRC interface tells you pretty detailed what part of the message is an emote and which one.