I\'ve got a wildcard pattern, perhaps \"*.txt\" or \"POS??.dat\".
I also have list of filenames in memory that I need to compare to that pattern.
How would
Some kind of regex/glob is the way to go, but there are some subtleties; your question indicates you want identical semantics to IO.DirectoryInfo.GetFiles
. That could be a challenge, because of the special cases involving 8.3 vs. long file names and the like. The whole story is on MSDN.
If you don't need an exact behavioral match, there are a couple of good SO questions:
glob pattern matching in .NET
How to implement glob in C#