Instance of RegExpT set up to search input.
import tango.io.Stdout; import tango.text.Regex; void main() { foreach(m; Regex("ab").search("qwerabcabcababqwer")) Stdout.formatln("{}[{}]{}", m.pre, m.match(0), m.post); } // Prints: // qwer[ab]cabcababqwer // qwerabc[ab]cababqwer // qwerabcabc[ab]abqwer // qwerabcabcab[ab]qwer
Set up for start of foreach loop.