title: How do I speed up text searches in R?
body: <p>I have a large text vector I would like to search for a particular character or phrase.  Regular expressions are taking forever.  How do I search it quickly?</p>
  
  <p>Sample data:</p>
  
  <pre><code>R &lt;- 10^7
  garbage &lt;- replicate( R, paste0(sample(c(letters[1:5]," "),10,replace=TRUE),collapse="") )
  </code></pre>