def METHOD_NAME(regex: str) -> str:
    # Fixes structure error produced by named groups like
    # ^simcore/services/comp/(?P<subdir>[a-z0-9][a-z0-9_.-]*/)*(?P<name>[a-z0-9-_]+[a-z0-9])$
    # into
    # ^simcore/services/comp/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$
    return re.sub(r"\(\?P<[^>]+>", "(", regex)