Loading ...
Sorry, an error occurred while loading the content.

20288RE: [Clip] triple consonants

Expand Messages
  • John Shotsky
    Feb 1, 2010
      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



      Before:

      This is a sentence with fffine mmmommas and slllight snnnails and rrreparations stttopping.

      After:

      This is a sentence with fine mommas and slight snails and reparations stopping.



      However, if there could be more than three matching consonants in a row, add pluses:

      ^!Replace "(?|(f)ff+|(l)ll+|(m)mm+|(n)nn+|(p)pp+|(r)rr+|(t)tt+)([aeiouäöü])" >> "$1$2" AHIRTSW

      Before:

      This is a sentence with fffffine mmmmmommas and slllllight snnnnnails and rrrrreparations stttttopping.

      After:

      This is a sentence with fine mommas and slight snails and reparations stopping.



      And finally, if it doesn’t really matter what follows the 3 or more target consonants, but you always want the triples
      or larger to be reduced to one:

      ^!Replace "(?|(f)ff+|(l)ll+|(m)mm+|(n)nn+|(p)pp+|(r)rr+|(t)tt+)" >> "$1" AHIRTSW

      Before: (Note the extra t’s in slight…)

      This is a sentence with fffffine mmmmmommas and slllllighttttt snnnnnails and rrrrreparations stttttopping.

      After:

      This is a sentence with fine mommas and slight snails and reparations stopping.



      Well, that was fun. Now for some coffee, so I can wake up… J

      Regards,

      John



      From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of Axel Berger
      Sent: Monday, February 01, 2010 2:13 AM
      To: ntb-clips@yahoogroups.com
      Subject: Re: [Clip] triple consonants





      Axel Berger wrote:
      > I want to find triple consonants like fff through Regex.

      I've found a solution that works:

      ^!Replace "(?|(ff)f|(ll)l|(mm)m|(nn)n|(pp)p|(rr)r|(tt)t)([aeiouäöü])" >>
      ""$1$2" HRASTI

      But I'd still be interested in a more elegant one. For me elegance means
      legible and easy to understand. I usually prefer useing several
      ^!Replaces in a row rather than one very clever one, that would take me
      several minutes to understand when I want to change something months
      later.

      Thanks
      Axel





      [Non-text portions of this message have been removed]
    • Show all 9 messages in this topic