title: remove text after final period in string
body: <p>I have a <code>grep</code> puzzle that's eluding me: I'd like to remove the text following the final period in a collection of strings (i am using R, so <code>perl</code> syntax is available). </p>
  
  <p>For example, say the string is <code>ABCD.txt</code> this <code>grep</code> would return <code>ABCD</code>, and if the text was <code>abc.com.foo.bar</code>, it would return <code>abc.com.foo</code>. </p>
  
  <p>Any help greatfully appreciated (i don't think i can drink any more coffee!). </p>