title: How to match the last word in a sentence?
body: <p>Suppose we have <em>one</em> sentence (several words without a dot after the last one).</p>
  
  <p>I need to wrap the last word with some html tags (for example, <code>&lt;strong&gt;lastword&lt;/strong&gt;</code>).</p>
  
  <p>How can I achieve this with java regular expressions?</p>
  
  <p>I've already tried this:</p>
  
  <pre><code>"John Doe Jr".replaceAll ("( .+$)", "&lt;strong&gt;$1&lt;/strong&gt;");
  </code></pre>
  
  <p>but it results in </p>
  
  <pre><code>John&lt;strong&gt; Doe Jr&lt;/strong&gt;
  </code></pre>
  
  <p>p.s. It's ok if we have a whitespace after <code>&lt;strong&gt;</code>, the main problem is that the pattern matches the biggest subsequence while I need the smallest one.</p>