title: Find files with matching patterns in a directory c#?
body: <pre><code> string fileName = "";
  
              string sourcePath = @"C:\vish";
              string targetPath = @"C:\SR";
  
              string sourceFile = System.IO.Path.Combine(sourcePath, fileName);
              string destFile = System.IO.Path.Combine(targetPath, fileName);
  
              string pattern = @"23456780";
              var matches = Directory.GetFiles(@"c:\vish")
                  .Where(path =&gt; Regex.Match(path, pattern).Success);
  
              foreach (string file in matches)
              {
                  Console.WriteLine(file); 
                  fileName = System.IO.Path.GetFileName(file);
                  Console.WriteLine(fileName);
                  destFile = System.IO.Path.Combine(targetPath, fileName);
                  System.IO.File.Copy(file, destFile, true);
  
              }
  </code></pre>
  
  <p>My above program works well with a single pattern.</p>
  
  <p>I'm using above program to find the files in a directory with a matching pattern but in my case I've multiple patterns so i need to pass multiple pattern in <code>string pattern</code> variable as an array but I don't have any idea how i can manipulate those pattern in Regex.Match.</p>
  
  <p>Can anyone help me?</p>