search() returns instance of RegExp set up to search string[].
import std.stdio; import undead.regexp; void main() { foreach(m; RegExp("ab").search("abcabcabab")) { writefln("%s[%s]%s", m.pre, m[0], m.post); } } // Prints: // [ab]cabcabab // abc[ab]cabab // abcabc[ab]ab // abcabcab[ab]
Set up for start of foreach loop.