title: How to use Regex to filter file names in c#?
body: <pre><code> Regex reg = new Regex(@"^[0-9]*\.wav");
    Stack&lt;string&gt; wavefiles= new Stack&lt;string&gt;(Directory.GetFiles("c:\\WaveFiles", "*.wav").Where(path =&gt; reg.IsMatch(path)));
  </code></pre>
  
  <p>what I am trying to do in the above code is to get all the wave files with names having only digits. for example "123.wav"</p>
  
  <p>when I try the above code it does not return any files ?</p>
  
  <p>any ideas what is wrong with my code?</p>