in reply to regex, find words that occur more than once.
use strict; # https://perlmonks.org/?node_id=11121725
use List::Util qw( uniq );
my $text = "and him him lad has him done and john has has";
print "$_\n" for uniq $text =~ /(\b\w+\b)(?=.*?\b\1\b)/g;
PerlMonks, of course - how could you ask?
Games & puzzles
Arts & music
Whichever pays my bills
Results (252 votes). Check out past polls.