Suppose I have the set of characters [ABC]
. I'm looking for a regex that would match any permutation of the superset except the empty set, i.e.
ABC ACB BAC BCA CAB CBA
AB BC AC CB CA BA
A B C
The regex should (obviously) not match the empty string.
p.s. An alternative way to express the same objective is "match any non-empty string containing each character in the set at most once".
update: The set [ABC]
is just an example, for the real set may also be bigger. With this question I was hoping to find a "general" solution rather than a particular one for [ABC]
.