Problems with string.gsub
I am trying to get plain text out of chat messages. I want to strip all the color codes, link information, etc. just leaving a plain text version of the message. Is there an existing method exposed that can do that?
I have been experimenting with using string.gsub to remove the text, but it doesn't work except for very simple patterns. For instance, in stand alone lua I can use this pattern to find item links and replace them with just plain text in square brackets. In my addon, it does nothing...
local textOut = string.gsub(textIn, 'H.-h(%[.-%])h', '%1')
|