1

I'd like to check if a given path matches a search pattern like *.* or report*.txt.

Directory.GetFiles (root, "*.txt") or similar should not be used (the file in question does not even exist).

My first idea was to translate the search pattern to regex, but I recall the search pattern behaves somewhat strangely at times (presumably for historic reasons), so it can probably not easily be translated.

Charles
  • 50,943
  • 13
  • 104
  • 142
mafu
  • 31,798
  • 42
  • 154
  • 247
  • [This](http://blogs.msdn.com/b/oldnewthing/archive/2007/12/17/6785519.aspx) might be helpful - but do you really care about the strange behaviour, or do you just need to support simple cases? – Blorgbeard Sep 12 '13 at 23:55
  • @Blorgbeard Thank you, that is an interesting link. It also shows that there were some very strange things, and (only) some of them were fixed in Windows 95. – mafu Sep 14 '13 at 11:30
  • I've thought about it again and I'll be fine with simple cases that I can emulate with something like regex. But others might not, so I'll leave this question up for reference, in case someone finds an answer. – mafu Sep 14 '13 at 11:31

0 Answers0