step one read the documentation for itertools and see what itertools magic will generate the kind of sets of matches you want. For example
>>> import itertools
>>> a=['aaa','bbb','ccc']
>>> for q in itertools.permutations(a):
... print q
...
('aaa', 'bbb', 'ccc')
('aaa', 'ccc', 'bbb')
('bbb', 'aaa', 'ccc')
('bbb', 'ccc', 'aaa')
('ccc', 'aaa', 'bbb')
('ccc', 'bbb', 'aaa')
To ensure that the matches are returned in a consistent manner tag each part of the regexp with ?P for example
>>> rl=[]
>>> bigr=""
>>> for q in itertools.permutations(a):
... r=""
... for ms in q:
... r = r + "(?P<" + ms + ">" + ms + ")"
... rl.append(r)
...
>>> rl
['(?P<aaa>aaa)(?P<bbb>bbb)(?P<ccc>ccc)', '(?P<aaa>aaa)(?P<ccc>ccc)(?P<bbb>bbb)', '(?P<bbb>bbb)(?P<aaa>aaa)(?P<ccc>ccc)', '(?P<bbb>bbb)(?P<ccc>ccc)(?P<aaa>aaa)', '(?P<ccc>ccc)(?P<aaa>aaa)(?P<bbb>bbb)', '(?P<ccc>ccc)(?P<bbb>bbb)(?P<aaa>aaa)']
In the example above I've used the match strings as the id tags in the P part of the expression. You could generate a "name1" "name2" or similar instead
Finally, join up all the little regexps into one giant regexp
onegiantregexp = "|".join(rl)
And use something like the re module "groupdict" to get the results
Hope this helps