title: regex to replace words with more than two consecutive characters
body: <p>How can I detect the presence of more than two consecutive characters in a word and remove that word?</p>
  
  <p>I seem to be able to do it like this:</p>
  
  <pre><code># example data
  mystring &lt;- c(1, 2, 3, "toot", "tooooot")
  # clunky regex
  gsub("^[[:alpha:]]$", "", gsub(".*(.)\\1+\\1", "", mystring)) 
  [1] "1"    "2"    "3"    "toot" "" 
  </code></pre>
  
  <p>But I'm sure there is a more efficient way. How can I do it with just one <code>gsub</code>?</p>