4 ms·
When I need to parse text with Lua, the first thing I reach for is LPeg. It's great when you can create a standalone expression to parse, say, an IPv4 address,
by spc476 4y ago
When I need to parse text with Lua, the first thing I reach for is LPeg. It's great when you can create a standalone expression to parse, say, an IPv4 address, then reuse that in a larger expression. And the data can be transformed as it's being parsed (say, converting a string of digits into an actual integer value).
I have a bunch of Lua modules based around LPeg: https://github.com/spc476/LPeg-Parsers https://github.com/spc476/LPeg-Parsers