WoW:API strfind: Difference between revisions

No change in size ,  24 March 2007
m
typos
(Added an example to demonstrate use with patterns)
m (typos)
Line 18: Line 18:
  13      13
  13      13


The pattern argument can be a regular expression which allows more complex searchs. See the [http://lua-users.org/wiki/PatternsTutorial Patterns Tutorial on Lua-Users.org] for more information. We can turn off the regular expression feature by using the optional fourth argument plain. plain takes a boolean value and must be preceeded by init. E.g.,
The pattern argument can be a regular expression which allows more complex searches. See the [http://lua-users.org/wiki/PatternsTutorial Patterns Tutorial on Lua-Users.org] for more information. We can turn off the regular expression feature by using the optional fourth argument plain. plain takes a boolean value and must be preceded by init. E.g.,


  > = string.find("Hello Lua user", "%su")          -- find a space character followed by "u"
  > = string.find("Hello Lua user", "%su")          -- find a space character followed by "u"
Anonymous user