def regex_tuple_from_key_alias(obj):
 return (re.compile(ordered_permutation_regex(' '.join(([obj.key] + obj.aliases.all()))), _RE_FLAGS), obj, obj.key)

def regex_tuple_from_key_alias ( obj ) : return ( re . compile ( ordered_permutation_regex ( ' ' . join ( ( [ obj . key ] + obj . aliases . all ( ) ) ) ) , _RE_FLAGS ) , obj , obj . key )
this will build a regex tuple for any object .