set a "10.20.30.40"set rest [regexp {[0-9]+\.([0-9]+)\.([0-9]+)\.[0-9]+} $a match submatch1 submatch2]puts $submatch1puts $submatch2
Standard input is empty
20 30
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!