lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


PA wrote:
On Sep 10, 2005, at 14:27, Shmuel Zeigerman wrote:

To get this functionality with Lua 5.1, one should use
2 functions instead: string.find and string.match.


Perhaps string.find() and string.sub()?

E.g.:

local aStart, anEnd = aContent:find( "%b<>", anIndex )

if aStart ~= nil then
    local aTag = aContent:sub( aStart, anEnd )

This doesn't give us captures.
So, string.match is still needed.
(Your example doesn't specify captures).

--
Shmuel