Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: regex issue

by Laurent_R (Canon)
on Aug 03, 2016 at 19:14 UTC ( #1169098=note: print w/replies, xml ) Need Help??

in reply to regex issue

Please better define what you mean with "three letter-doubles". The two monks that responded previously understood something different, and I understood yet a third possibility.

Please explain and/or provide an example.

Replies are listed 'Best First'.
Re^2: regex issue
by Anonymous Monk on Aug 03, 2016 at 19:17 UTC

    I meant all 3letter words that occur more than once.

      In that case:

      use strict; use warnings; my $term = 'Dit is het eerste het is niet het laatste Dit'; my @tlw = $term =~ /\b(\w{3})\b/g; # Now you have all the three-letter words, so count them my %seen = (); $seen{$_}++ for @tlw; for my $k (keys %seen) { print "$k occurs $seen{$k} times\n" if $seen{$k} > 1; }

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2022-05-18 02:29 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (68 votes). Check out past polls.