RegExp.opApply

Set up for start of foreach loop.

class RegExp
int
opApply
(
scope int delegate
(
ref RegExp
)
dg
)

Return Value

Type: int

search() returns instance of RegExp set up to search string[].

Examples

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]

Meta