def match(pattern,word):
    """Check if a word matches pattern

    Implements a very simple pattern matching algorithm, which allows
    only exact matches or glob-like strings (i.e. using a trailing '*'
    to indicate a wildcard).

    For example: 'ABC*' matches 'ABC', 'ABC1', 'ABCDEFG' etc, while
    'ABC' only matches itself.

    Arguments:
      pattern: simple glob-like pattern
      word: string to test against 'pattern'

    Returns:
      True if 'word' is a match to 'pattern', False otherwise.
    """
    if not pattern or pattern == '*':
        # No pattern/wildcard, matches everything
        return True
    # Only simple patterns considered for now
    if pattern.endswith('*'):
        # Match the start
        return word.startswith(pattern[:-1])
    else:
        # Match the whole word exactly
        return (word == pattern)