import re


def parseDecklistLine(line):
    """
    Parses the relevant information from a decklist line.
    """
    splitLine = line.split()
    if len(splitLine) < 1:
        return (None, None)
    if (re.match('\d+$',splitLine[0])):
        # A digit means a count. I hope.
        count = int(splitLine[0])
        cardName = ' '.join(splitLine[1:])
    else:
        # No digit, assuming count of one.
        count = 1
        cardName = line
    return (cardName, count)