title: How to replace only last match in a line with sed?
body: <p>With <code>sed</code>, I can replace the first match in a line using</p>
  
  <pre><code>sed 's/pattern/replacement/'
  </code></pre>
  
  <p>And all matches using</p>
  
  <pre><code>sed 's/pattern/replacement/g'
  </code></pre>
  
  <p>How do I replace only the <strong>last</strong> match, regardless of how many matches there are before it?</p>