Question: So I have a wordlist containing 3 words:

```
Apple
Christmas Tree
Shopping Bag

```

And I know only certain characters in the word and the length of the word, for instance:

> 
> *???i???as ?r??*
> 
> 
> 

where the **?** means it's an unknown character and I want to type it into the console and get an output of ALL the words in the word list containing these characters in these places and with this amount of characters. 

Is there any way I can achieve this? I want my program to function in the same way *<https://onelook.com/>* works.

Answer: 
You can turn your expression into a regex and try matching with that:

```
import re

words = [
    'Apple',
    'Christmas Tree',
    'Shopping Bag'
]

match = '???i???as ?r??'
regex = '^' + match.replace('?', '.') + '$'  # turn your expression into a proper regex

for word in words:    # go through each word
    if re.match(regex, word):   # does the word match the regex?
        print(word)

```

Output:

```
Christmas Tree

```
Try If `str` is in list.

```
IF "str" IN [list]

```