R, 46 45 bytes
cat(gsub("^\\w\\W*\\K\\w*","",scan(,""),T,T))
This reads a line from STDIN and prints to STDOUT. It uses a regular expression to remove all characters after the first letter followed by any amount of punctuation.
Ungolfed + explanation:
# Read a string from STDIN and convert it to a character vector, # splitting at spaces input <- scan(what = "") # Replace stuff with nothing using a regex. # ^ start position anchor # \w single "word" character # \W* any amount of non-word (i.e. punctuation) characters # \K move the match position forward # \w* any number of word characters replaced <- gsub("^\\w\\W*\\K\\w*", "", input, ignore.case = TRUE, perl = TRUE) # Print the vector elements to STDOUT, separated by a space cat(replaced, sep = " ")
Example:
> cat(gsub("^\\w\\W*\\K\\w*","",scan(,""),T,T)) 1: I'm a little teapot, short and stout. Here is my handle, here is my spout. When I get all steamed up - hear me shout! Tip me over and pour me out. I' a l t, s a s. H i m h, h i m s. W I g a s u - h m s! T m o a p m o.
+etc.) \$\endgroup\$O'Leary-Clarence-DeVoiswould becomeO'--? \$\endgroup\$