Skip to content
zetaepyon edited this page Jan 9, 2018 · 2 revisions

Provides the most necessary regular expression functions Lua is lacking.

windower.regex.match(string, pattern)

  • string string - String to search
  • pattern string - Regular expression pattern to search for

Returns a table containing matches, if they are found. Nested tables contain further capturing groups. Otherwise returns nil.

windower.regex.replace(string, pattern, replace)

  • string string - String to search
  • pattern string - Regular expression pattern to search for
  • replace string | table | function - String, function or table to replace the match with

Returns string with all matches of pattern replaced with replace. If replace is a table it will look up the match in it, if it is a function, it will pass the match as an argument and replace it with the returned value.

windower.regex.split(string, pattern)

  • string string - String to search
  • pattern string - Regular expression pattern to search for

Splits a string on a certain regular expression pattern. Returns a list of strings.