$string="abc de fgh ijkl"; while($string =~ /([a-z]+ [a-z]+)/g) { print "$1 $1\n"; }