FileSystemName.MatchesSimpleExpression Method

Definition

Verifies if the given expression matches the given name. Supports the following wildcards: '*' and '?'. The backslash character '\' escapes.

public static bool MatchesSimpleExpression(ReadOnlySpan<char> expression, ReadOnlySpan<char> name, bool ignoreCase = true);

Parameters

expression
ReadOnlySpan<Char>

The expression to match with.

name
ReadOnlySpan<Char>

The name to check against the expression.

ignoreCase
Boolean

true to ignore case (default); false if the match should be case-sensitive.

Returns

true if the given expression matches the given name; otherwise, false.

Applies to

Product Versions
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Standard 2.1