“Reverse Soundex” is a confusingly named thing whereby you use the last letter of the name rather than the first letter, as the code’s prefix and it’s otherwise standard Soundex
This implements actually reverse soundex, generating values that (coughs) roughly match the soundex code provided. It’s not a perfect implementation, but, eh, I don’t really care that much for this use case.
Input