my $string = <>; $string =~ /(\w*(\w)\w*\2\w*)/; # The beginning of the word, then a notable letter, # maybe some middle letters, then that same notable letter as before, # then the rest of the word. print "Found word '$1', with duplicated letter '$2'\n"; #### >image imagination dream Found word 'imagination', with duplicated letter 'n' >