Skip to content

Instantly share code, notes, and snippets.

@JeremyKuhne
Created March 9, 2018 01:33
Show Gist options
  • Save JeremyKuhne/5b14ed5d33397a8b7108be7726efbc2f to your computer and use it in GitHub Desktop.
Save JeremyKuhne/5b14ed5d33397a8b7108be7726efbc2f to your computer and use it in GitHub Desktop.
FileSystemName
namespace System.IO.Enumeration
{
public static class FileSystemName
{
// Change '*' and '?' to '<', '>', and '"' to match Win32 behavior
public static string TranslateWin32Expression(string expression);
// This matches '*', '?', '<', '>', and '"' wildcards
public static bool MatchesWin32Expression(ReadOnlySpan<char> expression, ReadOnlySpan<char> name, bool ignoreCase = true);
// This matches just '*' and '?' wildcards
public static bool MatchesSimpleExpression(ReadOnlySpan<char> expression, ReadOnlySpan<char> name, bool ignoreCase = true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment