import re


def _get_tile_index(regex, location):
    """
    Get tile index information from a location string.
    :param regex:
    :param location:
    :return: a tile index tuple
    """
    pattern = re.compile(regex)
    match = pattern.search(location)
    if match:
        tile_index0 = match.group('tile_index0')
        tile_index1 = match.group('tile_index1')
    else:
        tile_index0 = '999'
        tile_index1 = '999'
    return tile_index0, tile_index1