I am using hyperscan to search through large texts for a lot of regexes. One addition should be selective phonetic search for individual words. The algorithm of choice is Double Metaphone (but please feel free to recommend any other algorithm that might be more suitable to the problem and offers at least the same quality).
To search for phonetic matches I would have to translate every single word in my large text to its phonetic code and then compare them with the phonetic code of the word to search for. This is impractical for large texts. Also, to work together with hyperscan, I have to provide the search term as regex.
So my question is if it is possible to translate the phonetic code into a regex and pass it on, so that my text can remain unmodified while being searched?