import re


def get_sections(lines):
    """Get all the sections and the lines they contain."""

    result = {}
    current_section = None

    for line in lines:
        m = re.match(r'\[(\w+)\]', line)
        if m:
            current_section = m.group(1)
            result[current_section] = []
        elif current_section:
            result[current_section].append(line)

    return result