(re_match)
return ((k, v) for (k, v) in re_match.groupdict().items() if v)
Get only the non-empty named groups from an re.Match object.
Get only the non-empty named groups from an re.Match object.
Get only the non - empty named groups from an re . Match object .
def matched_named_groups(re_match):
    "Get only the non-empty named groups from an re.Match object."
    return ((k, v) for (k, v) in re_match.groupdict().items() if v)
def matched_named_groups ( re_match ) : return ( ( k , v ) for ( k , v ) in re_match . groupdict ( ) . items ( ) if v )