Text.search

Return a search iterator for a given pattern. The iterator sets the current text selection as appropriate. For example:

auto t = new Text ("hello world");
auto s = t.search ("world");

assert (s.next);
assert (t.selection() == "world");

Replacing patterns operates in a similar fashion:

auto t = new Text ("hello world");
auto s = t.search ("world");

// replace all instances of "world" with "everyone"
assert (s.replace ("everyone"));
assert (s.count is 0);
  1. Search!(T) search(const(T)[] match)
    class Text(T)
    Search!(T)
    search
    (
    const(T)[] match
    )
  2. Search!(T) search(T match)

Meta