I want to know if there is a way that I can use regex to create a regex search string for anagrams.
Related to this post: Regex - find anagrams and sub-anagrams
I've created this spreadsheet with the word database
The regex to search for anagrams of acne is : "^(?!.*a.*a)(?!.*c.*c)(?!.*n.*n)(?!.*e.*e)[acne]*$"
(from the aforementioned stackoverflow question).
I would like to use regexreplace to get from "acne" (or bacon or whatever string of letters to get to) "^(?!.*<letter1>.*<letter1>)<repeat for each letter>[<letterstring>]*$"
?
If tried regexreplace("acne",".",".*")
but that returns .*.*.*.*
obviously. And what I was looking for is .*a.*c.*n.*e
to then from there extrapolate further to get to "^(?!.*a.*a)(?!.*c.*c)(?!.*n.*n)(?!.*e.*e)[acne]*$"
Obviously I'd love it solve the multiletter dilemmas too: ^(?!.*([agoid]).*\1)(?!(.*m){3})[magoid]*$
but not sure how easy this will be with repeat letters.