I want to write a regular expression in my python code, but I think this is more of a mathematical challenge.
So my requirement is, suppose I want to create $3$ unique coupon codes, I can write a regular expression like [a-z]{3} this would allow me to match any three character coupon code, but there are more than $3$ possible result space for the given regex, it is $26^{3}$ possible values here.
I was thinking of creating a regex which would have a dynamic base like say binary, or hexadecimal or decimal with a varying length of allowed characters, this would allow me to create at most $x$ number of coupon codes where $x > n$.
And then have another regex with a result space of $y$, that would negate into the extra result space of $x$, such that $n = x - y$
Is this possible? What are your opinions?