I am using v12.2.0. As a minimal example, the idea is to find all words that have two pairs of matching characters and two other characters for a total of 6
characters. The question is similar to 67518 (as I discovered later).
p1 = Alternatives @@
Permutations@StringExpression[a_, a_, c_, d_, b_, b_];
p2 = Alternatives @@
Permutations@StringExpression[a_, a_, b_, c_, d_, b_];
Sort[p1] === Sort[p2]
DictionaryLookup[p1]
DictionaryLookup[p2]
True
{}
{"eerier"}
Trying these patterns on the cloud gives results with 793 entries each. This seems like a bug for my version. So, I wanted to somehow incorporate the OrderlessPatternSequence
.
Question
My question is whether StringExpression
can be used in conjunction with OrderlessPatternSequence
instead of relying on Permutations
for such tasks? For more readability, can Repeated
be incorporated with such a pattern?