title: Exact match with grepl R
body: <p>I'm trying to extract certain records from a dataframe with grepl.</p>
  
  <p>This is based on the comparison between two columns Result and Names. This variable is build like this "WordNumber" but for the same word I have multiple numbers (more than 30), so when I use the grepl expression to get for instance Word1 I get also results that I would like to avoid, like Word12.</p>
  
  <p>Any ideas on how to fix this?</p>
  
  <pre><code>Names &lt;- c("Word1")
  colnames(Names) &lt;- name
  Results &lt;- c("Word1", "Word11", "Word12", "Word15")
  Records &lt;- c("ThisIsTheResultIWant", "notThis", "notThis", "notThis") 
  Relationships &lt;- data.frame(Results, Records)
  
  Relationships &lt;- subset(Relationships, grepl(paste(Names$name, collapse = "|"), Relationships$Results))
  </code></pre>
  
  <p>This doesn't work, if I use <code>fixed = TRUE</code> than it doesn't return any result at all (which is weird). I have also tried concatenating the name part with other numbers like this, but with no success:</p>
  
  <pre><code>Relationships &lt;- subset(Relationships, grepl(paste(paste(Names$name, '3', sep = ""), collapse = "|"), Relationships$Results))
  </code></pre>
  
  <p>Since I'm concatenating I'm not really sure of how to use the \b to enforce a full match.</p>
  
  <p>Any suggestions?</p>