title: regex remove everything after character including that charecter
body: <p>I want to complete a regex which matches everything after a certain character including that character. eg if my string is </p>
  
  <p><code>"12:23:34:45:56"</code></p>
  
  <p>I want to return</p>
  
  <p><code>"12:23:34:45"</code></p>
  
  <p>Where everything after the last <code>:</code> has been removed including the <code>:</code></p>
  
  <p>I tried the below.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var str1 = "12:23:34:45:56";
  str1 = str1.replace(/[^:]*$/,"");
  alert(str1);</code></pre>
  </div>
  </div>
  </p>
  
  <p>Which returns <code>"12:23:34:45:"</code> (need to get rid of the last :)</p>
  
  <p>I also tried </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var str2 = "12:23:34:45:56";
  str2 = str2.replace(/:.*$/,"");
  alert(str2);</code></pre>
  </div>
  </div>
  </p>
  
  <p>which returns <code>"12"</code> matches to much of the string</p>
  
  <p>How can I get what I want here?</p>