Raw Input
Cryptography is the art, or science, of secret writing.
It has been widely used as a way to provide private
conversions very early in human history. In the context
of modern computing, it is associated with private
electronic communications. It may be used to protect
files, e-mail, and various types of network
connections. 
Desired Output
Cryptography
provide private
conversions
associated
communications
various network
connections
Script and Comments
Script1
[ 1] s/[^A-Za-z]*\([A-Za-z][A-Za-z]*\)[^A-Za-z]*/\n\1/g
[ 2] /\n/!d
[ 3] s/[^\n]/#&/g
[ 4] :loop
[ 5] /#.#/{
[ 6] s/\(\n[^\n]*\)#/\1/g
[ 7] b loop
[ 8] }
[ 9] s/\n[^#]*//g
[10] s/^.//
[11] s/#/ /g
Comments
  1. A word is defined as '[A-Za-z]+'.
  2. Step [1] will insert a newline character at the beginning of every word. Non-word part of the line will be deleted.
  3. We use Step [2] to ignore lines that do not contain any word.
  4. Insert a '#' before each non-newline character.
  5. For example, if the original line contains 'this', it will become '\n#t#h#i#s' after Step [4].
    • Step [4] thru [8] constitute a loop.
    • Each iteration of the loop will remove one '#' of each word.
    • This loop will be executed repeatedly until no word contains at least two '#'s.
  6. After exiting the loop, the word(s) that still has '#' will be the longest one(s). Each of them has only one '#', and the '#' lies before the first character of the word.
  7. Step [9] will remove all non-longest words and newlines, but '#'s will survive.
  8. We use Step [10] to delete the '#' at the beginning of the line, Step [11] to change '#'s to spaces.