print(string.gsub("a !foo walking", "%S+",{ ["!foo"] = "bar",}))
Standard input is empty
a bar walking 3
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!