fork download
  1. import re
  2. p = re.compile(r'(?<!C\(=O\))N')
  3. strs = ["C(=O)N", "C(=O)CN", "C(=O)NCCCN"]
  4. print([x for x in strs if p.search(x)])
Success #stdin #stdout 0.01s 9016KB
stdin
Standard input is empty
stdout
['C(=O)CN', 'C(=O)NCCCN']