To list the possible anagrams of a given string, we can use a recursive function that generates all of the permutations of the input string. Here's an example implementation in C#:
main.cs1015 chars34 lines
We can use the result of this function to create a regular expression that matches any of the possible anagrams. Here's an example implementation:
main.cs398 chars14 lines
This function returns a regular expression that matches any of the possible anagrams of the input string, surrounded by word boundary matchers to ensure exact matches.
gistlibby LogSnag