title: regex last character of a WORD
body: <p>I'm attempting to match the last character in a WORD.</p>
  
  <p>A WORD is a sequence of non-whitespace characters
  '[^\n\r\t\f ]', or an empty line matching ^$.</p>
  
  <p>The expression I made to do this is: 
  "[^ \n\t\r\f]\(?:[ \$\n\t\r\f]\)"</p>
  
  <p>The regex matches a non-whitespace character that follows a whitespace character or the end of the line. </p>
  
  <p>But I don't know how to stop it from excluding the following whitespace character from the result and why it doesn't seem to capture a character preceding the end of the line.</p>
  
  <p>Using the string "Hi World!", I would expect: the "i" and "!" to be captured.</p>
  
  <p>Instead I get: "i ".</p>
  
  <p>What steps can I take to solve this problem?</p>