Skip to content

Instantly share code, notes, and snippets.

@Quacky2200
Quacky2200 / repermute.py
Last active February 13, 2024 18:31 — forked from mdeous/repermute.py
Generate all possible permutations of a regex (Python v3)
# -*- coding: utf-8 -*-
#
# Used like this:
#
# from repermute import ipermute
#
# for s in ipermute('[A-Z]\d'):
# print s
#
# Almost all regular expression constructs are supported except for '*'