wlegrand has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I'm on Perl v5.18.2 but I would prefer to have this work with Perl v5.10 I can use Perl to find words in my Dictionary that have doubled letters in various positions using variations of this that I manually adjust to fit the word.
perl -wnl -e '/(?i)\A(?=\w{10}\z)[a-z]{2}([a-z])\1[a-z]([a-z])\2/ and print;' filenThis will search for 10 letter words with doubled letters at positions 3, 4 and 6, 7. It has a letter pattern of abCCdEEfgh where C stands for the 3rd and 4th letter position and D stands for the 6th and 7th letter position. I get 181 words.</>
babbittess .......... yellowwort
Now I am searching for the type of word that is 12 letters long that has no consecutive doubled letters but has repeated letters. Ex. reservations which has a letter pattern of ABcBAefghijh where A stands for the 1st and 5th letter position and B stands for the 2nd and 4th letter position. There are 25,176 twelve letter words in my Dictionary and I need some way to extract the words that match that type of pattern. Perl can do any text manipulation but I can't. A one-liner or a script. I will adjust the one-liner or script manually for other pattern words. Can you help?
Willi
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Words, no consecutive doubled letters but repeated letters
by GrandFather (Saint) on Oct 27, 2022 at 21:10 UTC | |
|
Re: Words, no consecutive doubled letters but repeated letters
by kcott (Archbishop) on Oct 28, 2022 at 08:40 UTC | |
|
Re: Words, no consecutive doubled letters but repeated letters (updated x2)
by AnomalousMonk (Archbishop) on Oct 27, 2022 at 20:41 UTC | |
|
Re: Words, no consecutive doubled letters but repeated letters
by LanX (Saint) on Oct 27, 2022 at 19:35 UTC | |
|
Re: Words, no consecutive doubled letters but repeated letters
by tybalt89 (Monsignor) on Oct 28, 2022 at 18:17 UTC | |
|
Re: Words, no consecutive doubled letters but repeated letters
by Anonymous Monk on Oct 29, 2022 at 16:37 UTC |