def _generate(seq_re_list, sequence):
    """Find matches in the sequence by the useful SeqRegexObject,
    and generate the result pattern."""
    seq_re_used_indices = []
    for i, sr in enumerate(seq_re_list):
        if not sr.is_useless_for(sequence):
            seq_re_used_indices.append(i)
    for sr_i in seq_re_used_indices:
        sr = seq_re_list[sr_i]
        generated_pattern = []
        matches = sr.finditer(sequence)
        for match in matches:
            for name in sorted(match.named_group_dict, key=lambda g: match.
                named_group_dict[g][0]):
                generated_pattern.append(match.format_group_to_str(name,
                    trimmed=True))
            yield ''.join(generated_pattern)
