re:exec |
---|
Summary Matches a regexp to a string, returning offsets Prototype
Description This takes a regular expression object compiled previously with rex.new, and matches it against a target string. It takes the same arguments are re:match, however the table returned as the 3rd result consists of pairs of offsets, rather than the strings themselves.
Output from table.foreach: 1 1 2 4 3 11 4 14 In this case we see that the first capture was from columns 1 to 4, and the second capture was from columns 11 to 14. See Also ... Lua functions
re:gmatch - Matches a regexp to a string, applying a function
Topics
Lua base functions
(Help topic: lua=re:exec) |
Enter a search string to find matching documentation.
Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.