This function or event no longer exists in version 6.0.2 (19034) of World of Warcraft. Please check the main API page for an up-to-date listing of the valid API functions
Returns information about matches for a pattern in a string. Alias for the standard library function
nil if no matches are found.
See also Lua library functions.
s- A string (
pattern- A regular expression pattern (
init- Initial position in the string
sat which to begin the search; defaults to 1 if omitted (
plain- True to perform a simple substring search (i.e. considering
patternonly as a literal string, not a regular expression); false or omitted otherwise (
start- Character position in
sat which the first match begins (
end- Character position in
sat which the first match ends (
...- Captured substrings from
patternspecifies captures (
strfind("Welcome to Azeroth!", "Azeroth") -- returns 12, 18 strfind("|cffffff00|Hquest:982:17|h[Deep Ocean, Vast Sea]|h|r", "quest:(%d+):([-%d]+)|h%[(.-)%]") -- returns 11, 48, "982", "17", "Deep Ocean, Vast Sea"