'Parse a key defining a match against fields into its components.'

def parse_match_fields_key(self, key):

    matches = self._match_field_key_regex.match(key)
    if (not matches):
        raise AutoModeratorSyntaxError(('Invalid    search    check:    `%s`' % key), self.parent.yaml)
    parsed = {}
    name = matches.group(1)
    all_valid_fields = set.union(*self._match_fields_by_type.values())
    fields = [field.strip() for field in name.lstrip('~').partition('#')[0].split('+')]
    for field in fields:
        if (field not in all_valid_fields):
            raise AutoModeratorSyntaxError(('Unknown    field:    `%s`' % field), self.parent.yaml)
    valid_fields = self._match_fields_by_type[self.target_type]
    fields = {field for field in fields if (field in valid_fields)}
    if (not fields):
        raise AutoModeratorRuleTypeError(("Can't    search    `%s`    on    this    type" % key), self.parent.yaml)
    modifiers = matches.group(2)
    if modifiers:
        modifiers = [mod.strip() for mod in modifiers.split(',')]
    else:
        modifiers = []
    for mod in modifiers:
        if (mod not in self._match_modifiers):
            raise AutoModeratorSyntaxError(('Unknown    modifier    `%s`    in    `%s`' % (mod, key)), self.parent.yaml)
    return {'name': name, 'fields': fields, 'modifiers': modifiers, 'match_success': (not name.startswith('~'))}
