'Returns a list of indices of the cards matching the given wildcard
pattern.
* \'*\' matches 0 or more characters
* \'?\' matches a single character
* \'...\' matches 0 or more of any non-whitespace character'

def _wildcardmatch(self, pattern):

    pattern = pattern.replace('*', '.*').replace('?', '.')
    pattern = (pattern.replace('...', '\\S*') + '$')
    pattern_re = re.compile(pattern, re.I)
    return [idx for (idx, card) in enumerate(self._cards) if pattern_re.match(card.keyword)]
