-
Couldn't load subscription status.
- Fork 445
Regex Functions
zetaepyon edited this page Jan 9, 2018
·
2 revisions
Provides the most necessary regular expression functions Lua is lacking.
-
stringstring - String to search -
patternstring - Regular expression pattern to search for
Returns a table containing matches, if they are found. Nested tables contain further capturing groups. Otherwise returns nil.
-
stringstring - String to search -
patternstring - Regular expression pattern to search for -
replacestring | 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.
-
stringstring - String to search -
patternstring - Regular expression pattern to search for
Splits a string on a certain regular expression pattern. Returns a list of strings.