## Re: [Clip] triple consonants

Expand Messages
• Why not ... ^!Replace (?|(f)f+|(l)l+(m)m+|(n)n+|(p)p+|(r)r+|(t)t+)([aeiouäöü]) \$1\$2 AIRSTW Will that work? Finding two or more? Maybe some before or
Message 1 of 9 , Feb 1, 2010
Why not ...
^!Replace "(?|(f)f+|(l)l+(m)m+|(n)n+|(p)p+|(r)r+|(t)t+)([aeiouäöü])" >>
"\$1\$2" AIRSTW
Will that work? Finding two or more?

Maybe some before or after samples would help us see what you are
actually doing :-)

John Shotsky wrote:
> Axel,
>
> Does that really work? I ask because you said you wanted to replace triples with singles, but yours appears to capture
> doubles. There is one too-many double quotes too. Is there a requirement that a vowel follow the triple? What if a
> space, punctuation, line end or other consonant follows? How about other accented vowels, as in sauté? What if there are
> 4 or 5 of the wanted consonants in succession?
>
>
>
> A slight modification:
>
> ^!Replace "(?|(f)ff|(l)ll|(m)mm|(n)nn|(p)pp|(r)rr|(t)tt)([aeiouäöü])" >> "\$1\$2" AIRSTW
• Can you break that down for us? g is ... something out of the prior group? So any time you have two of the prior in a row (will it however mix and match or
Message 2 of 9 , Feb 1, 2010
Can you break that down for us?
\g is ... something out of the prior group?
So any time you have two of the prior in a row (will it however mix and
match or does \d insist on it being the SAME letter?

explains what it does ...

> This seems to do the trick for me:
> ^!Replace "([flmnprt])(\g1)\g1" >> "\$1\$2" WARIS
• ... Yes it does. I know I said I wanted to find just the single letter, but my first attempt would have inserted it twice. The extra double quote too was part
Message 3 of 9 , Feb 1, 2010
John Shotsky wrote:
> Does that really work?

Yes it does. I know I said I wanted to find just the single letter, but
my first attempt would have inserted it twice. The extra double quote
too was part of the replace string to be written. The result is TeX
notation for hyphenation in traditional German spelling. Whenever three
identical consonants are follwed by a vowel in composite words, only two
are written, but the third is resurrected in hyphenation. Thus in bed
sheet "Bett" plus "Tuch" become Bettuch and are hypenated Bett-tuch.

> How about other accented vowels, as in sauté?
> What if there are 4 or 5 of the wanted consonants in succession?

Neither is possible in the spelling of German words.

Danke
Axel
• ... You could try something like this: ^!Replace (?i)(? (?![aeiou])( pL) 1{2}) \$1 RAWS or to disallow mixed case triples: ^!Replace
Message 4 of 9 , Feb 1, 2010
On 2/1/2010 4:03 AM, Axel Berger wrote:
> I want to find triple consonants like fff through Regex. Instead of the
> obvious way I tried to be clever, which of course backfired. The term
>
> (f|l|m|n|p|r|t){3}
>
> finds three consonants in a row, even if they're different. Is there a
> clever alternative to
>
> (fff|lll|...)? The main reason I ask is not cleverness for its own sake
> but that I need a single found consonant in my replace string, i.e. for
> "fff" I need "f" and so on.
>
> Thanks
> Axel
>
>

You could try something like this:

^!Replace "(?i)(?>(?![aeiou])(\pL)\1{2})" >> "\$1" RAWS

or to disallow mixed case triples:

^!Replace "(?>(?![AEIOUaeiou])(\pL)\1{2})" >> "\$1" RAWS

Regards,
Sheri
• ... Thanks, that s it. I ve modified it slightly to come up with: ^!Replace (f|l|m|n|p|r|t) 1{2}([aeiouäöü]) \$1\$1\$2 HRASTI Danke Axel
Message 5 of 9 , Feb 1, 2010
diodeom wrote:
> This seems to do the trick for me:
> ^!Replace "([flmnprt])(\g1)\g1" >> "\$1\$2" WARIS

Thanks, that's it. I've modified it slightly to come up with:

^!Replace "(f|l|m|n|p|r|t)\1{2}([aeiouäöü])" >> ""\$1\$1\$2" HRASTI

Danke
Axel
Your message has been successfully submitted and would be delivered to recipients shortly.