def METHOD_NAME(db_string) -> str:
    """Parse database string into the following components:
        username, password, host, port, database 
    """
    match = re.match(r"postgresql\+psycopg2:\/\/(?P<username>[a-zA-Z0-9_]+):(?P<password>[^@]+)@(?P<host>[^:]+):(?P<port>\d+)\/(?P<database>\w+)", db_string)
    if not match:
         raise ValueError("Invalid database string")
    username = match.group("username")
    password = match.group("password")
    host = match.group("host")
    port = match.group("port")
    database = match.group("database")
    return username, password, host, port, database