If I understand your question, you're looking for a Python approach to matching patterns by a set of strings.
Here is an example demonstrating the use of lists to achieve this.
, . , , .
- JL
>>> import re
>>> s = ["abccba", "facebookgooglemsmsgooglefacebook"]
>>> p = "xyzzyx"
>>> result = [ re.search(p,str) for str in s ]
>>> result
[None, None]
>>> p = "abc"
>>> result = [ re.search(p,str) for str in s ]
>>> result
[<_sre.SRE_Match object at 0x100470780>, None]
>>> [ m.group(0) if m is not None else 'No Match' for m in result ]
['abc', 'No Match']
>>> [ m.string if m is not None else 'No Match' for m in result ]
['abccba', 'No Match']
>>> [ m.string if m is not None else 'No Match' for m in [re.search(p,str) for str in s] ]
['abccba', 'No Match']