title: grep exact match in vector inside a list in R
body: <p>I have a list like this:</p>
  
  <pre><code>map_tmp &lt;- list("ABC",
                  c("EGF", "HIJ"),
                  c("KML", "ABC-IOP"),
                  "SIN",
                  "KMLLL")
  
  
  &gt; grep("ABC", map_tmp)
  [1] 1 3
  &gt; grep("^ABC$", map_tmp)
  [1] 1  # by using regex, I get the index of "ABC" in the list
  &gt; grep("^KML$", map_tmp)
  [1] 5  # I wanted 3, but I got 5. Claiming the end of a string by "$" didn't help in this case.
  &gt; grep("^HIJ$", map_tmp)
  integer(0) # the regex do not return to me the index of a string inside the vector
  </code></pre>
  
  <p>How can I get the index of a string (exact match) in the <strong>list</strong>?
  I'm ok not to use <code>grep</code>. Is there any way to get the index of a certain string (exact match) in the list? Thanks!</p>