|
I have just released version 0.2.1 of the matchext library, a fork of
Lua's pattern-matching facilities spawned out of a proposal for a new
feature last month. The new version can be installed with:
luarocks install matchext
The major feature of 0.2 is new table functions. These functions
("tmatch", "tgmatch", and "tgsub") produce, in place of the normal
results, a table of match data containing the match itself, all
captures, the start and end positions of the match and captures, plus
a copy of the source string and pattern. The table also has a method
allowing gsub-style expansion of a replacement string based on the
captures in the table. The table and these functions are described in
more detail in the new documentation in the README on the GitHub
repository. [1]
This is 0.2.1, which fixes a bug I overlooked and discovered
immediately after releasing 0.2.0 tonight. (0.2.0 has been deleted
from LuaRocks.)
Bug reports and other issues can be submitted to the Issues section on
GitHub. [2] Pull requests are welcome as well, should you be so
inclined. I hope you are able to find this library useful, and I will
be working on more features as I have time to do so (see the LuaRocks
page [3] for a list of potential ideas).
[1] https://github.com/jcgoble3/lua-matchext
[2] https://github.com/jcgoble3/lua-matchext/issues
[3] http://luarocks.org/modules/jcgoble3/matchext