oh sorry, re is the regular expression module http://docs.python.org/2/library/re.html, so just `import re`

it will yield a list of matches, for your examples:
```python
>>> re.findall('from subject (\w+)', ', from subject  vex2ras=TkReg')
[]
>>> re.findall('from subject (\w+)', ', from subject sample')
['sample']
>>> re.findall('from subject (\w+)', ', from subject sample vox2ras=TkReg')
['sample']
```
so just check whether the length of what is returned is one or zero