Given a string, we would like to reverse the letters in each word while maintaining the original order of words, spaces and punctuation. Words are separated by spaces and punctuation marks, and there are no numbers. The words consist of lower or upper case letters (so no hyphens), and the case of letters should be preserved in the final answer.
This IS a word-teSt,yo!should turn into
sihT SI a dorw-tSet,oy!.
Avoid using tokenizers (e.g.
wordReverse("This IS a word-teSt,yo!");
"sihT SI a drow-tSet,oy!"