set a "10.20.30.40"regsub {\.([0-9]+)\.([0-9]+)\.} $a {.\2.\1.} bputs $b
Standard input is empty
10.30.20.40
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!