lua-users home
lua-l archive

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


I've regularly come across another issue while using gsub (Lua 4), but I
guess its also there for gfind in Lua 5.  It seems to be impossible to write
a single pattern that splits a string into its comma-seperated parts,
allowing for empty parts.  (Try it, it can be puzzling!)  The workaround I
use most of the times is to append an additional comma to the string first.
That's not too bad, but still...  A possible solution would be to allow the
"end-of-string" character $ inside a character set without losing its
special meaning.  Then the pattern could tentatively be "(.-)[,$]".  I'm not
sure how other regex systems handle this or how difficult it would be to
support it in the Lua implementation (which performs excellently by the
way!)  Any thoughts on this one??

Bye,
Wim