title: Is there a way to filter a set of strings based on whether they appear as part of longer strings?
body: <p>I know how to use grepl to see if a list of longer strings contains a list of shorter strings:</p>
  <pre><code>short &lt;- c(&quot;aa&quot;,&quot;bb&quot;,&quot;cc&quot;,&quot;dd&quot;)
  long &lt;- c(&quot;aabb&quot;,&quot;abbc&quot;,&quot;abca&quot;)
  grepl(paste(short, collapse = '|'), long)
  
  [1]  TRUE  TRUE FALSE
  </code></pre>
  <p>But how could I find out whether the list of shorter strings contains <strong>part</strong> of any of the longer strings? Merely reversing the two sets returns 4 FALSE of course, because none of the shorter strings contains the longer strings. In this case my desired output would be:</p>
  <pre><code>TRUE TRUE FALSE FALSE
  </code></pre>
  <p>Newish to R so no idea if <code>grepl</code> is the right solution here. Any help appreciated.</p>