RegExp.search

Set up for start of foreach loop.

class RegExp
search
(
string string
)

Return Value

Type: RegExp

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