title: find words in a text divided in sentences R
body: <p>Hello there I have a text and I'd like to retrieve only the sentences that contains certain words. Here is an example.</p>
  <pre><code>my_text&lt;- tolower(c(&quot;Pro is a molecule that can be found in the air. This molecule spreads glitter and allows bees to fly over the rainbow. For flying, bees need another molecule that is Sub. Sub is activated and so Sub is a substrate. After eating that molecule bees become very speed and they can fly highly. Pro activate Sub. This means that Sub is catalyzed by Pro.&quot;))
  
  
  my_words &lt;- tolower(c(&quot;Pro&quot;, &quot;Pra&quot;, &quot;Pri&quot;, &quot;Pre&quot;, &quot;Pru&quot;, 
           &quot;Sab&quot;, &quot;Seb&quot;, &quot;Sib&quot;, &quot;Sob&quot;, &quot;Sub&quot;))
  
  sent &lt;- unlist(strsplit(my_text, &quot;\\.&quot;))
  
  sent &lt;- sent[grep(pattern = my_words, sent, ignore.case = T)] 
  </code></pre>
  <p>using this code I have this warning message</p>
  <pre><code>Warning message:
  In grep(pattern = my_words, sent, ignore.case = T) :
    argument 'pattern' has length &gt; 1 and only the first element will be used
  </code></pre>
  <p>How I can avoid this? I want to analyze all words of my vector. I looked at stringr package but I couldn't find a solution.</p>
  <p>The code can change anyway, I just showed what I've done!</p>