human
Write me a the Python code you requested given the following:
I found an interesting problem on https://www.codewars.com/kata/5631ac5139795b281d00007d:
Design a data structure that supports the following two operations:

* `addWord` (or `add_word`) which adds a word,
* `search` which searches a literal word or a regular expression string containing lowercase letters `"a-z"` or `"."` where `"."` can represent any letter

You may assume that all given words contain only lowercase letters.

## Examples
```python
add_word("bad")
add_word("dad")
add_word("mad")

search("pad") == False
search("bad") == True
search(".ad") == True
search("b..") == True
```

**Note:** the data structure will be initialized multiple times during the tests!

I tried it in Python, but could not do it. Can you solve it?
assistant
#Here is the Python code you requested.

import re
class WordDictionary:
    def __init__(self):
       self.words = []
    
    def add_word(self,v):
       self.words.append(v)
  
    def search(self,rg):
        return any(re.match(r'^{}$'.format(rg),i) for i in self.words)