def _parse_metal_choice(s, max_value):
    """
    Parse user options provided in ``detect_metal_options``.

    The syntax is <position>,[<new name>], using semicolons to choose several ones.
    <new name> can only be 3-letters max and should not collide with existing Amber
    types. This is not checked, so be careful! If you choose several ones, they
    are considered part of the same metal center! Do not use it for unrelated ions;
    instead run the script several times and use the step 1n.
    For example:

        - 0  # would select the first one (default), without renaming
        - 0:ZN1 # select first one with a new name (ZN1)
        - 0:ZN1 1:ZN2 # select first and second with new names

    Parameters
    ==========
    s : str

    Return
    ======
    list of (index, name)
        name can be None
    """
    if not s:
        return [(0, None)]
    result = []
    for selection in s.split():
        name = None
        fields = selection.split(':')
        if len(fields) == 1:
            name == None
        elif len(fields) == 2 and 0 < len(fields[1]) <= 3:
            name = fields[1]
        else:
            raise ValueError('    !!! Wrong syntax!')
        index = int(fields[0])
        if index < 0 or index >= max_value:
            raise ValueError('    !!! Index must be within 0 and ' + str(max_value))
        result.append((index, name))
    return result