Lua: split string into words unless quoted
问题 So I have the following code to split a string between whitespaces: text = "I am 'the text'" for string in text:gmatch("%S+") do print(string) end The result: I am 'the text' But I need to do this: I am the text --[[yep, without the quotes]] How can I do this? Edit: just to complement the question, the idea is to pass parameters from a program to another program. Here is the pull request that I am working, currently in review: https://github.com/mpv-player/mpv/pull/1619 回答1: There may be ways