def parse_card(card, text, default=None):
    """Parse a card from an input string
    
    """
    match = re.search(card.lower() + r"\s*=\s*(\w+)", text.lower())
    return match.group(1) if match else default
Parse a card from an input string