title: Selecting elements from list
body: <p>I have a list of names in a list, such as:</p>
  
  <pre><code>site&lt;-list("site2-site22" ,"site2-site45", "site4-site2", "site6-site2",
             "site9-site27", "site20-site150", "site25-site272", "site32-site47",
             "site62-site74", "site272-site280")
  </code></pre>
  
  <p>From the list, I need to select those elements which has site2 in it, either before or after - </p>
  
  <p>When I use grep command as below:</p>
  
  <pre><code>grep("site2",site,value=T)
  </code></pre>
  
  <p>It gives me all values starting from site2, that is my results looks like:</p>
  
  <pre><code>"site2-site22"    "site2-site45"    "site4-site27"    "site9-site27" 
  "site20-site150"  "site25-site272"  "site272-site280"
  </code></pre>
  
  <p>How can i only select site2 from the list?</p>