def build_str_closures(s, lexid, iterator):
    """Builds the pair of closures for recognizing exact strings.
    """
    def match_str(iterator):
        return iterator.source.startswith(s, iterator.pos)

    def result_str(iterator):
        return lexid, s, iterator.pos + len(s)

    return (match_str, result_str)