def find_tokens(text, tokenizer):
    """Return a generator of `{"token", "character", "target"}` dictionaries by
    tokenizing some text.

    `text` -- `string` -- the text to tokenize

    `tokenizer` -- `regex.Regex` -- the tokenizer to use on the text
                   (supporting `finditer`)

    `return` -- `generator(dict)` -- a generator of tokens, which have keys:

      - `token` -- `int` -- index of the token in the message
      - `character` -- `int` -- index of the first character of the token in
                       the message
      - `target` -- `string` -- the text content of the token itself
    """
    for i, m in enumerate(tokenizer.finditer(text)):
        yield dict(token=i, character=m.span()[0], target=m.group())
