^(%S*)%s*(%S*)%s*(%S*)%s*(%S*)$
My thought, WOW!
https://www.lua.org/pil/20.2.html
So you are telling it to check at the beginning of the string with the ^ symbol. Group 1 you look for Zero or more non space chars. Then for the default group (which isn't really a group) you look for Zero or more spaces. Then Group 2 you look for Zero or more non space chars. The default group again for Zero or more spaces. Then Group 3 you look for Zero or more non space chars. Then a third time, the default group again for Zero or more spaces. Then Group 4 you look for Zero or more non space chars. The last group matches up to the end of the string with the $ symbol, as long as it isn't a space.
The default group might actually be group 1 for Lua which means that you have 1 through 5 rather then the default and 1 through 4.