#!/perl use warnings; use strict; while(){ #print map {"$_\n"} grep{/!/} split; /(\w*!\w*)/g && print "$1\n"; } __DATA__ Mary had a little lamb! , whose fleece! was white! as snow. And everywhere! that Mary went, the lamb was sure! to go. oops!eedaisy