'Search a list of targets of the same type as caller.
Args:
caller (Object or Player): The type of object to search.
namelist (list): List of strings for objects to search for.
Returns:
targetlist (list): List of matches, if any.'

def search_targets(self, namelist):

    nameregex = '|'.join((('^%s$' % re.escape(name)) for name in make_iter(namelist)))
    if (hasattr(self.caller, 'player') and self.caller.player):
        matches = list(ObjectDB.objects.filter(db_key__iregex=nameregex))
    else:
        matches = list(PlayerDB.objects.filter(username__iregex=nameregex))
    return matches
