def format_field_by_match(self, value, match):
groups = match.groups()<EOL>fill, align, sign, sharp, zero, width, comma, prec, type_ = groups<EOL>if not comma and not prec and type_ not in list('<STR_LIT>'):<EOL><INDENT>return None<EOL><DEDENT>if math.isnan(value) or math.isinf(value):<EOL><INDENT>return None<EOL><DEDENT>locale = self.numeric_locale<EOL>prefix = get_prefix(sign)<EOL>if type_ == '<STR_LIT:d>':<EOL><INDENT>if prec is not None:<EOL><INDENT>raise ValueError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>string = format_number(value, <NUM_LIT:0>, prefix, locale)<EOL><DEDENT>elif type_ in '<STR_LIT>':<EOL><INDENT>format_ = format_percent if type_ == '<STR_LIT:%>' else format_number<EOL>string = format_(value, int(prec or DEFAULT_PREC), prefix, locale)<EOL><DEDENT>else:<EOL><INDENT>return None<EOL><DEDENT>if not comma:<EOL><INDENT>string = remove_group_symbols(string, locale)<EOL><DEDENT>if not (fill or align or zero or width):<EOL><INDENT>return string<EOL><DEDENT>spec = '<STR_LIT>'.join([fill or u'<STR_LIT>', align or u'<STR_LIT:>>',<EOL>zero or u'<STR_LIT>', width or u'<STR_LIT>'])<EOL>return format(string, spec)<EOL>
Formats a field by a Regex match of the format spec pattern.