View Single Post
  #6  
Old 12-23-2009, 09:44 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Lua syntax, it's from one of my WoW addons:
PHP Code:
msg gsub(msg"^|Hchannel:(%S+)|h%[([%d%.%s]*)([^%]]+)%]|h ""|Hchannel:%1|h" .. channelFormat .. "|h "); 
Basically, this replaces the display format of the channel escape sequence (WoW stuff) at the start of the string msg (if any escape sequence exists) with a predefined new format stored in channelFormat.
WoW channel escape sequences work like this:
PHP Code:
|Hchannel:CHANNEL_HERE|hCHANNEL_DISPLAY_NAME_HERE|
If you want to know some more details, either ask, or check out patterns on the Lua website. Also, as far as I know, Lua implements regular expressions a tad differently compared to other languages, so you might also want to check out the PHP documentation.
Reply With Quote