Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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

by tybalt89 (Monsignor)
on Sep 14, 2020 at 15:13 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11121740]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2024-04-23 08:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found