def parse_modifiers(modifiers):
    """Parse modifiers(regex match object) into type sets then return them."""
    weaknesses, immunities = set(), set()
    sections = modifiers.group(1).split(';')
    for section in sections:
        split = [w.strip(',') for w in section.strip().split(' ')]
        for word in split[2:]:
            if split[0] == 'weak':
                weaknesses.add(word)
            else:
                immunities.add(word)

    return (weaknesses, immunities)