def display(regexes, sel_regex, scr, regex_win, out_win, start_y=0, start_x
    =0, lines=None):
    """
    Displays the input matched against the regexes in two windows.
    """
    regex_win.clear()
    out_win.clear()
    for i, regex in enumerate(regexes):
        color = None if regex is not sel_regex else 'green'
        regex_win.write(regex.regex_str, pos=(0, i), color=color)
    regex_win.refresh()
    out_w, h = out_win.max_size()
    out_win.write('=' * out_w, pos=(0, 0), color='blue')
    if sel_regex is not None:
        output = sel_regex.output[start_y:start_y + h]
        for i, out in enumerate(output):
            pos = 0, i + 1
            out.draw(out_win, pos, start_x=start_x)
    else:
        for i, line in enumerate(lines):
            if i < start_y:
                continue
            if i >= start_y + h - 1:
                break
            out_win.write(line[start_x:], pos=(0, i - start_y + 1), color=
                'yellow')
    if sel_regex:
        total = f"MATCH:{sel_regex.stats()['matches']}/{len(sel_regex.output)}"
    else:
        total = f'MATCH:0/{len(lines)}'
    out_win.write(
        f'{total}  ?:help  q:quit  e:edit  w:regex_up  s:regex_down  r:out_up  f:out_down  [:page_up  ]:page_down'
        , pos=(0, h - 1), color=('white', 'blue'))
    out_win.refresh()
