Quantcast
WoWInterface - View Single Post - gsub'ing |t and stuff
View Single Post
11-25-10, 01:47 PM   #5
Xinhuan
A Chromatic Dragonspawn
 
Xinhuan's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 174
Originally Posted by Xubera View Post
if your gsub above removes a texture... like

|TTexturePaththerjunk:morejunk|t

is what your trying to remove, just do a

text = text:gsub("\124T.*\124t", "")

that removes the |T and |t and everything in between
Careful there. You should use

text = text:gsub("\124T.-\124t", "")

instead to capture the smallest possible amount of text between |T and |t. This is because .* captures the longest possible amount of text and if the text contains 2 texture links, you will get rid of all the text between the 2 textures.
__________________
Author of Postal, Omen3, GemHelper, BankItems, WoWEquip, GatherMate, GatherMate2, Routes and Cartographer_Routes
  Reply With Quote