lua-users home
lua-l archive

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

I used the example:


     t = {}

     s = "from=world, to=Lua"

     for k, v in string.gmatch(s, "(%w+)=(%w+)") do

       t[k] = v



found in the reference manual under string.gmatch (s, pattern).  It works well for something I’m doing.


However, I would also like to allow “_” in the characters before and after the “=”.  I have read through the Patterns section, but have not come up with a working character class modification to do the job.  Can this be done?