title: Regex to match last space character
body: <p>I need some help. I am looking for a regex that would match the last space character in a string. I am using JavaScript and classic ASP.</p>
  
  <p>I have a long string of text which I trim to 100 characters. I would like to remove the last character to avoid a spelling mistake if the trim cuts a word due to the 100 characters limit.</p>
  
  <pre><code>regex.replace(/[ ]$.*?/ig, '');
  </code></pre>
  
  <p>Anybody with ideas? Thanks.</p>