Regex to obtain everything till the second to last occurrence
<p>For example if I have <code>rrr.abc.tsy.html</code></p>
<p>I just want <code>rrr.abc</code></p>
<p>How can I use a regular expression to extract everything prior to the <em>second to last</em> occurrence of <code>.</code> (the period character)?</p>