Evaluated proc rr sub { set src [wget http://www.reddit.com/r/$sub.json]; set re [regexp -all -inline {id": "(.+?)".+?title": "(.+?)".+?url": "(.+?)"} $src]; set result [list ""]; for {set i 1} {$i < [llength $re]} {incr i 3} { linsert $result end {[# $re $i] [# $re [+ $i 1]] [# $re [+ $i 2]]} }; join $result \n }