Pattern

A pattern is a simple string format for describing multiple "patterns" that can be matched to user provided input.

Description: A simple pattern of "hello" would match, and only match "hello".

A pattern of "hello|world" would match either "hello" or "world".

Some patterns may contain spaces, other may not, it should be documented if possible.

Members

Functions

assertNoWhitespace
void assertNoWhitespace()

Asserts that there is no whitespace within the pattern.

byEach
auto byEach()
defaultPattern
string defaultPattern()

The default subpattern can be used as the default 'user-facing' name to display to the user.

matchSpacefull
bool matchSpacefull(ArgPullParser parser, AllowPartialMatch allowPartial)

Advances the given token parser in an attempt to match with any of this pattern's subpatterns.

matchSpaceless
bool matchSpaceless(string toTestAgainst)

Matches the given input string without splitting up by spaces.

Variables

pattern
string pattern;

The raw pattern string.

Meta