title: Using grepl in R to match string
body: <p>I have a frame data "testData" as follows:</p>
  
  <pre><code>id     content
   1     I came from China
   2     I came from America
   3     I came from Canada
   4     I came from Japan
   5     I came from Mars
  </code></pre>
  
  <p>And I also have another frame data "addr" as follows:</p>
  
  <pre><code>id   addr
   1   America
   2   Canada
   3   China
   4   Japan
  </code></pre>
  
  <p>Then how can I use <code>grepl</code>, <code>sapply</code> or any other useful function in R to generate data into as follows:</p>
  
  <pre><code>id   content               addr
   1   I came from China     China
   2   I came from America   America
   3   I came from Canada    Canada
   4   I came from Japan     Japan
   5   I came from Mars      Mars
  </code></pre>