title: Exact pattern match in r
body: <p>I am reading files from a folder using List.files but i want to read only specific files to be read. I have files like below. </p>
  
  <pre><code>D420000900100hour.1-4-2001.31-12-2001
  D420000700600hour8.1-1-2001.31-12-2004
  D420000500150hour.1-1-2001.31-12-2004
  </code></pre>
  
  <p>Notice here i have "hour" and "hour8". I want to only list files containing exactly "hour". </p>
  
  <pre><code> files &lt;- list.files(pattern = "hour")
  </code></pre>
  
  <p>With this piece of code however it returns files with both "hour" and "hour8". I am trying to use ^ and $. but they dont seem to work with "pattern". </p>
  
  <p>How do i do this. </p>