Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: regex, find words that occur more than once.

by tybalt89 (Prior)
on Sep 14, 2020 at 15:13 UTC ( #11121740=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    
    ...
    
    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;
    
  2. or download this
    and
    him
    has
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11121740]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2020-11-27 11:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?