Matches a regexp to a string, applying a function
The gmatch function:
Tries to match the regex re against string up to count times (or as many as possible if count is either not given or is not a positive number), subject to execution flags "flags".
Each time there is a match, fun is called as fun (m, t), where m is the matched string and t is a table of substring matches (this table contains false in the positions where the corresponding sub-pattern did not match.).
If fun returns a true value, then gmatch immediately returns.
gmatch returns the number of matches made.
Output from function during execution:
See Also ...
Lua base functions
(Help topic: lua=re:gmatch)
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.
Gammon Software support
Forum RSS feed ( https://gammon.com.au/rss/forum.xml )