WordPattern

WordPattern class

Represents a word pattern for the wildcard search.

public class WordPattern

Constructors

Name Description
WordPattern() Initializes a new instance of the WordPattern class.

Methods

Name Description
AppendCharacter(char) Appends a character to the word pattern.
AppendOneCharacterWildcard() Appends one character wildcard to the word pattern.
AppendOneOrMoreCharactersWildcard() Appends one or more characters wildcard to the word pattern.
AppendString(string) Appends a string to the word pattern.
AppendWildcard(int, int) Appends a wildcard to the word pattern.
AppendZeroOrMoreCharactersWildcard() Appends zero or more characters wildcard to the word pattern.
AppendZeroOrOneCharacterWildcard() Appends zero or one character wildcard to the word pattern.
override ToString() Returns a String that represents the current WordPattern.

Remarks

A pattern is a sequence of values, each of them either a character or a wildcard. A wildcard carries the flag that puts it above MaxValue, together with the least and the greatest number of characters it stands for, therefore a character of the pattern is anything that fits into a UTF-16 code unit.

The characters of the terms of an index are UTF-16 code units as well, so a wildcard counts code units: a character above the basic multilingual plane, for example an emoji that the alphabet of the index makes a letter, is two units, which two one-character wildcards or a wildcard of two characters match, and AppendOneCharacterWildcard matches one of them. The wildcards of a query in the text form, such as ?, count the same way.

See Also