title: Phrase match in a sentence using R
body: <p>I need to match multiple phrases in a sentence using R and save it in columns beside it. Example:</p>
  
  <pre><code>   sentence &lt;- c("My CPU is working but keyboard is not working", "unable
                    access printer", "unable access printer and keyboard is not working")  
     phrase   &lt;- c("unable access printer", "keyboard is not working")
  </code></pre>
  
  <p>I want my output in below data frame format:</p>
  
  <pre><code>      sentence                                             phrase1                  phrase2
    My CPU is working but keyboard is not working         keyboard is not working       NA
    unable access printer                                      NA                       NA
    unable access printer and keyboard is not working     unable access printer        keyboard is not working
  </code></pre>
  
  <p>Request you to please guide me with the approach or R code. Thanks! </p>