I'm looking for a more efficient way of matching multiple arbitrary domains from a block of text. 

I have a block of text looks like this:

```
'''
    foo
    my.domain1
    batman.my.domain1
    superman.my.domain2 foo bar wonderwoman.my.domain1
'''

```

I want to match all subdomains of  

`my.domain1` and 
`my.domain2` 

Desired output here would be: 

> 
> ['batman.my.domain1', 'superman.my.domain2', 'wonderwoman.my.domain1']
> 
> 
> 

I have accomplished the task partially by using this monster of a regex that surely can't be the most efficient way to do this:

```
r'(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-]{,}[a-zA-Z0-9])?\.)+my.domain1|(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-]{,}[a-zA-Z0-9])?\.)+my.domain2'

```

Is there a better way to do this? 

Example code: 

```
import re

text = '''
    foo
    my.domain1
    batman.my.domain1
    superman.my.domain2 foo bar wonderwoman.my.domain1
'''

pattern = r'(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-]{,}[a-zA-Z0-9])?\.)+my.domain1|(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-]{,}[a-zA-Z0-9])?\.)+my.domain2'
print(re.findall(pattern, text))

# Desired output is:
# ['batman.my.domain1', 'superman.my.domain2', 'wonderwoman.my.domain1']

```

P.S - my.domain1 and my.domain2 are example domains, real ones will not have numbers at the end.