Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Words, no consecutive doubled letters but repeated letters

by GrandFather (Saint)
on Oct 27, 2022 at 21:10 UTC ( [id://11147758]=note: print w/replies, xml ) Need Help??


in reply to Words, no consecutive doubled letters but repeated letters

Solving this sort of problem can be made much easier if you break it into parts. Use a simple regex to drop words containing doubled letters then you can use a simple regex to find repeated letters.

use warnings; use strict; my %words = map {$_ => 1} split ' ', "This will search for words with +doubled letters at positions"; print "$_\n" for grep {!/(\w)\1/ && /(\w).+\1/} sort keys %words;

Prints:

doubled positions
Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-19 17:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found