import rep = re.compile(r'(?<!C\(=O\))N')strs = ["C(=O)N", "C(=O)CN", "C(=O)NCCCN"]print([x for x in strs if p.search(x)])
Standard input is empty
['C(=O)CN', 'C(=O)NCCCN']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!