lua-users home
lua-l archive

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


> I know there is a regex library somewhere

http://sc3d.org/rrt/ under "Lua". Also linked to from lua.org. I know it's
not pure Lua, but in my view it's often better: you don't have to remember
yet another syntax (although Lua's is fine). The main advantage of Lua's
package is that it's smaller and faster (in particular, glibc's matching
seems to take time proportional to the length of the searched string,
regardless of where the first match is), and gsub provides in-place
substitution (with my package, as with the underlying POSIX API, you have to
edit the string yourself).

I do think it would be worth making these two pluggable replacements, though
(as they nearly are at the moment), because then for a lot of applications
(Lua-SS?) it might well be preferable to support just POSIX regexs.

-- 
http://sc3d.org/rrt/ | The only person worth beating is yourself