Keep It Simple, Stupid | |
PerlMonks |
Re: Words, no consecutive doubled letters but repeated lettersby LanX (Saint) |
on Oct 27, 2022 at 19:35 UTC ( [id://11147754]=note: print w/replies, xml ) | Need Help?? |
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 PS: > abCCdEEfgh ... and D stands for the 6th and 7th letter position I think you meant E
In Section
Seekers of Perl Wisdom
|
|