Add and search word - DS [How to manage '.' characters in the trie]

I implemented the trie ds which can add and search words but i want to know what is the best way to implement searching of:-

search(".ad") -> true
search("b..") -> true

how to manage '.' because now we've to check every possibility for the words and return if there is no word present with same pattern.

Update : Managed to solve with recursion.

Comments (1)