def METHOD_NAME(qasm_str: QASMType) -> List[str]:
    """Use regex to extract all qreg definitions from the string"""
    matches = re.findall(r"qreg (\w+)\[(\d+)\];", qasm_str)
    result = []
    for match in matches:
        var_name = match[0]
        n = int(match[1])
        result.extend([f"{var_name}[{i}]" for i in range(n)])
    return result