title: R Regex remove everything after Underscore if underscore is after position 3
body: <p>I have been searching for a solution for two days.</p>
  
  <p>Here is a sample of what my data looks like and what I would like to achieve:</p>
  
  <pre><code>dat &lt;- c("f__dfty","fd_fgtekg","f_glgkt_s2","f_glgkt_s3","fthssfy_s2","fthssfy_s3","h__gkdnt_s2","sedfgrtsd")
  dat &lt;- c("f__dfty","fd_fgtekg","f_glgkt","f_glgkt","fthssfy","fthssfy","h__gkdnt","sedfgrtsd")
  </code></pre>
  
  <p>I need to remove everything after an "_", but not if the underscore is in position 2 and or 3 of the string.  Not every string will have an underscore.</p>
  
  <p>Thanks!</p>