title: how can I use perl-like regular expressions in R to match exact string held within a vector?
body: <p>I have a data frame containing a number of similar IDs and associated information:</p>
  
  <pre><code>col1 = c("id_string", "1id_string", "id_string1")    
  col2 = c("x", "y", "z")    
  col3 = c("d", "e", "f")    
  data = data.frame(col1, col2, col3)
  </code></pre>
  
  <p>I have a vector (output from a loop) containing a string that I wish to use for matching:</p>
  
  <p><code>id = "id_string"</code> </p>
  
  <p>I have used grep to match the string held within the vector with all rows in data$col1 containing the string </p>
  
  <p><code>grep(id, data$col1)</code></p>
  
  <p>However, I wish to extract only the row numbers from data$col1 with the exact string held within id (no characters before / after). How can I achieve this?</p>