re:gmatch

Matches a regexp to a string, applying a function

Prototype

result = re:gmatch (string, fun, count, flags)

Description

The gmatch function:

re = rex.new ("(\[A-Za-z\]+)")
n = re:gmatch ("Nick goes East", function (m, t) print (m) end )
print (n) --> 3
Output from function during execution:

Nick
goes
East

Lua functions

Topics