Trie + DFS for '.' is how you discuss pattern matching in constrained vocabularies.
Enable JavaScript for the full StreamPrep guide.