Article 5N3GH Seeking 7-letter words containing 2 Us

Seeking 7-letter words containing 2 Us

by
danielbmartin
from LinuxQuestions.org on (#5N3GH)
This topic is only a learning exercise.

Wanted: a list of English words which...
- are 7 letters long
- contain exactly 2 Us in any sequence

Examples: fulcrum and surplus are good
but cumulus and unusual are not.

My solution...
Code:WordList='/usr/share/dict/words'
sed -rn '/^.{7}$/p' $WordList \
|sed -rn '/u.*u/p' \
|sed -r '/u.*u.*u/d'This works but it seems clumsy.

Brainteaser: is there an elegant RegEx which could do this with only one sed?

Daniel B. Martin

.latest?d=yIl2AUoC8zA latest?i=ioqLAKb5ezU:B09fbKICHq4:F7zBnMy latest?i=ioqLAKb5ezU:B09fbKICHq4:V_sGLiP latest?d=qj6IDK7rITs latest?i=ioqLAKb5ezU:B09fbKICHq4:gIN9vFwioqLAKb5ezU
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments