Fixes issue on Windows platform that was preventing file system names containing underscores (_) from being considered valid

This commit is contained in:
BinaryAlley committed 2024-09-22 16:24:07 +03:00
1 parent 7dedec0f9b
commit 35fe931173
1 file changed
+1 -1
@@ -52,7 +52,7 @@ public class WindowsPathStrategy : IWindowsPathStrategy
return false;
// regular expression to match valid absolute paths
// this allows drive letters (e.g., C:\) and UNC paths (e.g., \\server\share)
var pathPattern = @"^[a-zA-Z]:\\(?:[a-zA-Z0-9\s().-]+\\)*[a-zA-Z0-9\s().-]*\\?$";
var pathPattern = @"^[a-zA-Z]:\\(?:[a-zA-Z0-9\s()._-]+\\)*[a-zA-Z0-9\s()._-]*\\?$";
return Regex.IsMatch(path.Path, pathPattern);
}