License:
BSD style: see license.txtVersion:
May 2009: Initial releasesince:
0.99.9Author:
Krisfunction:
1 2 3 4 5 6 7 8 9 | auto match = find ("foo"); auto content = "wumpus foo bar" // search in the forward direction auto index = match.forward (content); assert (index is 7); // search again - returns length when no match found assert (match.forward(content, index+1) is content.length); |
1 2 3 4 5 6 | char[] result; auto match = find ("foo"); foreach (token; match.tokens ("$foo&&foo*", "bar")) result ~= token; assert (result == "$bar&&bar*"); |
1 2 3 4 5 6 | int count; auto f = find ("foo"); foreach (index; f.indices("$foo&&foo*")) ++count; assert (count is 2); |
function:
1 2 3 4 5 6 7 8 9 | auto match = search ("foo"); auto content = "wumpus foo bar" // search in the forward direction auto index = match.forward (content); assert (index is 7); // search again - returns length when no match found assert (match.forward(content, index+1) is content.length); |
1 2 3 4 5 6 | char[] result; auto match = search ("foo"); foreach (token; match.tokens("$foo&&foo*", "bar")) result ~= token; assert (result == "$bar&&bar*"); |
1 2 3 4 5 6 | int count; auto match = search ("foo"); foreach (index; match.indices("$foo&&foo*")) ++count; assert (count is 2); |