I was looking through tutorials on the roblox wiki and I found that

print( string.gsub("hello world from Lua", "(%w+)%s*(%w+)", "%2 %1") )

would print

>world hello Lua from 2

What gets me here is the extra "2". The code is supposed to just rearrange the two captures, but why is it adding in extra?