lua-users home
lua-l archive

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


What would be a reasonable way to, hmmm, quote unquoted tokens?

Say a token is an uninterrupted sequence of alphanumeric characters (%w) or a quoted token. A quoted token is any sequence of characters inside quotes, minus any quote characters.

For example:

'foo "hello world" bar'

How to turn the above into:

'"foo" "hello world" "bar"'