Table of Contents

Method WildcardMatch

Namespace
DocWright.Dom.Fields
Assembly
DocWright.Dom.dll

WildcardMatch(string, string)

Matches text against a Word field wildcard pattern, where * matches any run of characters and ? matches exactly one.

public static bool WildcardMatch(string text, string pattern)

Parameters

text string

The text to test.

pattern string

The pattern.

Returns

bool

true if the text matches.

Remarks

Case-sensitive and culture-free: "abc" = "AB*" is false in Word, and so is "abc" = "?BC". Phase 14 matched case-insensitively, which was inferred from the same wrong reading that made the whole comparison case-insensitive.

Exceptions

ArgumentNullException

text or pattern is null.