Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Words, no consecutive doubled letters but repeated letters

by LanX (Saint)
on Oct 27, 2022 at 19:35 UTC ( [id://11147754]=note: print w/replies, xml ) Need Help??


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

You already know how to do the A and B part with backreferences (it's even straight forward with named captures called A and B)

The harder part is to exclude repetition in c..efghijh

... one way is repeated negative look-aheads, another splitting and counting.

We had a similar question just recently: Nonrepeating characters in an RE

You'll find these and many other helpful suggestions discussed there!

HTH! :)

Cheers Rolf
(addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
Wikisyntax for the Monastery

PS:

> abCCdEEfgh ... and D stands for the 6th and 7th letter position

I think you meant E

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2024-03-29 09:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found