m
→"Regexes" (patterns) in Lua
m (→"Regexes" (patterns) in Lua: Corrected wrong description of string.match) |
|||
| Line 7: | Line 7: | ||
* [[API_strfind|string.find]](string, pattern) -- finds the first instance of pattern in string | * [[API_strfind|string.find]](string, pattern) -- finds the first instance of pattern in string | ||
* string.gfind(string, pattern) -- when called repeatedly, finds each successive instance of pattern in string | * string.gfind(string, pattern) -- when called repeatedly, finds each successive instance of pattern in string | ||
* string.gsub(string, pattern, repl) -- returns a string where all instances of pattern in string have been replaced with repl | * [[API gsub|string.gsub]](string, pattern, repl) -- returns a string where all instances of pattern in string have been replaced with repl | ||
* string.match(string, pattern, init) -- Returns | * [[API strmatch|string.match]](string, pattern, init) -- Returns a list of matches of pattern in string, starting search at init (1 is the first character of string, 2 is the second, etc.). | ||
== Constructing a pattern == | == Constructing a pattern == | ||