m
no edit summary
(overall tweaks) |
mNo edit summary |
||
| Line 5: | Line 5: | ||
Lua has a few string functions that use patterns (what some people mistakenly call regexes). Among them are | Lua has a few string functions that use patterns (what some people mistakenly call regexes). Among them are | ||
* 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 | * string.gsub(string, pattern, repl) -- returns a string where all instances of pattern in string have been replaced with repl | ||