title: How to do complex regular expressions in list.files in R
body: <p>I cannot find any example on how to use the <code>pattern=</code> parameter in <code>list.files</code> for more complex operations.</p>
  
  <p>I would like to get all the files that include either <em>'XM'</em> or <em>'EM'</em> and are of the <em>.cvs</em> type</p>
  
  <p>Can someone please help me.</p>
  
  <p>I was trying something like</p>
  
  <p><code>list.files(path='.', pattern="[XM | EM] &amp; csv")</code></p>
  
  <p>but it is definitely wrong</p>