Created
October 24, 2014 13:21
-
-
Save Ffisegydd/34d32e0f8a68b6756aaf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import permutations | |
import re | |
letters = 'abc' | |
perm = set(p for n in range(1, len(letters)+1) for p in permutations(letters, n)) | |
s = r"@({})\b".format('|'.join(''.join(p) for p in perm)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment