Talk:Pattern matching

From Warcraft Wiki
Jump to navigation Jump to search

This is a great How-To

---

Only problem is that Lua doesn't have regular expressions. They look like REs to a layman, but... real regular expressions are one heck of a lot more powerful (and more complex). Jae 15:01, 22 Dec 2005 (EST)

how do i use this in TBC2?

/script if (string.find(UnitName("target"),"Bob")~=nil) then CastSpellByName("Hunter's Mark") else ClearTarget() end

now,can not work in TBC2,how do i get this function in TBC by string Pattern ?

longsky.soul*gmail.com

I don't know when this was asked; however, CastSpellByName is a protected function and cannot be used in this manner except to activate tracking abilities and open crafting frames. Posted by: EGingell (T|C|F) on 01:38, May 26, 2010 (UTC)