fuzzyMatchesRaw

Works like fuzzyMatchesUni, but does not do any UTF decoding, but rather just goes through the arrays element-by-element.

This method works case-sensitive if dstrings are passed into it.

This method has no dependency on the standard library and should work with betterC.

@safe pure nothrow @nogc
bool
fuzzyMatchesRaw
(
R1
R2
)
(
scope const R1 doesThis
,
scope const R2 matchThis
)
if (
!shouldBeDecoded!R1 &&
!shouldBeDecoded!R2
)

Examples

assert( "foo"d.fuzzyMatchesRaw(""d));
assert( "foo"d.fuzzyMatchesRaw("fo"d));
assert(!"foo"d.fuzzyMatchesRaw("Fo"d));
assert(!"foo"d.fuzzyMatchesRaw("b"d));

assert( "path/to/game.txt"d.fuzzyMatchesRaw("pathgametxt"d));
assert( "path/to/game.txt"d.fuzzyMatchesRaw("ptg"d));
assert(!"path/to/game.txt"d.fuzzyMatchesRaw("ptf"d));

assert([1, 2, 3, 4, 5].fuzzyMatchesRaw([1, 3, 5]));
assert(![1, 2, 3, 4, 5].fuzzyMatchesRaw([1, 5, 3]));
assert([1, 2, 3, 4, 5].fuzzyMatchesRaw([1, 5]));
assert([1, 2, 3, 4, 5].fuzzyMatchesRaw([5]));
assert(![1, 2, 3, 4, 5].fuzzyMatchesRaw([0]));

Meta