There is a file "a" in a directory. When I search by ".", I get "a".
But the file "a" doesn't have a extension and there is no dot in "a". Why?
Asked
Active
Viewed 954 times
1

Jerry Chou
- 180
- 1
- 11
-
1This isn't a programming question... – Morgan Apr 19 '18 at 04:52
-
But I also test it using C# and I still get the "a". `string[] res=System.IO.Directory.GetFiles("c:\\dir", ".");` The sencond parameter "searchPattern" doesn't support regular expressions, as msdn said. https://msdn.microsoft.com/en-us/library/ms143316(v=vs.110).aspx – Jerry Chou Apr 19 '18 at 05:27
-
There's an implied `.` in every windows filename. `a` == `a.` Because every windows file has an extension, even if that's empty. You might try `*.+` or `*.+([a-z]|[A-Z])` although I experienced one behavior at cmd prompt, another in UI, and .NET may provide yet another. You might look at: https://stackoverflow.com/questions/188892/glob-pattern-matching-in-net and this documentation *might* apply to System.IO https://learn.microsoft.com/en-us/vsts/build-release/tasks/file-matching-patterns?view=vsts – zzxyz Apr 19 '18 at 18:21