You can write a program to generate all permutations and use that as your regexp.
For example abc maps to abc|acb|bac|bca|cab|cba. You can rearrange it as
a(bc|cb)|b(ac|ca)|c(ab|ba) to see how an n letter permutation is computed from
permutations of n-1 letters. I don’t think you can do better.
On May 29, 2022, at 9:12 PM, Dave Horsfall
<dave(a)horsfall.org> wrote:
I remember when the documentation was easy to read, but now...
I'm trying to find a regex i.e. as used by GREP to find all words in
"badugly" with each letter used only once and all are 7-letter words i.e.
they are all anagrams; perhaps it's my age (I hit 70 soon, after decades
in Unix) but I cannot seem to find a way to restrict the count i.e. each
letter used only once, but in any order.
I'll guess that it involves some obscure use of "{}*\" etc, which
I've
never really grokked...
Ta muchly.
-- Dave