title: Use grepl to search either of multiple substrings in a text
body: <p>I am using grepl() in R to search if either of the following <em>genres</em> exist in my text. I am doing it like this right now:</p>
  <pre><code>grepl(&quot;Action&quot;, my_text) |
  grepl(&quot;Adventure&quot;, my_text) |
  grepl(&quot;Animation&quot;, my_text) |
  grepl(&quot;Biography&quot;, my_text) |
  grepl(&quot;Comedy&quot;, my_text) |
  grepl(&quot;Crime&quot;, my_text) |
  grepl(&quot;Documentary&quot;, my_text) |
  grepl(&quot;Drama&quot;, my_text) |
  grepl(&quot;Family&quot;, my_text) |
  grepl(&quot;Fantasy&quot;, my_text) |
  grepl(&quot;Film-Noir&quot;, my_text) |
  grepl(&quot;History&quot;, my_text) |
  grepl(&quot;Horror&quot;, my_text) |
  grepl(&quot;Music&quot;, my_text) |
  grepl(&quot;Musical&quot;, my_text) |
  grepl(&quot;Mystery&quot;, my_text) |
  grepl(&quot;Romance&quot;, my_text) |
  grepl(&quot;Sci-Fi&quot;, my_text) |
  grepl(&quot;Sport&quot;, my_text) |
  grepl(&quot;Thriller&quot;, my_text) |
  grepl(&quot;War&quot;, my_text) |
  grepl(&quot;Western&quot;, my_text)
  </code></pre>
  <p>Is there a better way to write this code? Can I put all the genres in an array and then somehow use <code>grepl()</code> on that?</p>