undead.string

Contains the obsolete pattern matching functions from Phobos' std.string.

Members

Functions

countchars
size_t countchars(S s, S1 pattern)

Count characters in s that match pattern.

inPattern
bool inPattern(dchar c, S pattern)

See if character c is in the pattern. Patterns:

inPattern
bool inPattern(dchar c, S[] patterns)

See if character c is in the intersection of the patterns.

munch
S1 munch(S1 s, S2 pattern)

Finds the position pos of the first character in s that does not match pattern (in the terminology used by std.string.inPattern). Updates s = s[pos..$]. Returns the slice from the beginning of the original (before update) string up to, and excluding, pos.

removechars
S removechars(S s, S pattern)

Return string that is s with all characters removed that match pattern.

squeeze
S squeeze(S s, S pattern)

Return string where sequences of a character in s[] from pattern[] are replaced with a single instance of that character. If pattern is null, it defaults to all characters.

Meta