title: RegExp to filter characters after the last dot
body: <p>For example, I have a string "esolri.gbn43sh.earbnf", and I want to remove every character after the last dot(i.e. "esolri.gbn43sh"). How can I do so with regular expression?</p>
  
  <p>I could of course use non-RegExp way to do it, for example:</p>
  
  <p>"esolri.gbn43sh.earbnf".slice("esolri.gbn43sh.earbnf".lastIndexOf(".")+1);</p>
  
  <p>But I want a regular expression.</p>
  
  <p>I tried <code>/\..*?/</code>, but that remove the first dot instead.</p>
  
  <p>I am using Javascript. Any help is much appreciated.</p>