wget http://en.wikipedia.org/wiki/List_of_Internet_top-level_domains && perl -MIO::All -le ' my @x; BEGIN{@x = io("/usr/share/dict/words")->chomp->slurp} while (<>) { /title="\.([^"\s+]+)/ or next; $re = qr/${1}$/; print for (grep {s/($re)/.$1/} @x) } ' List_of_Internet_top-level_domains