fork download
  1. import re
  2. p = re.compile(r'-(?!(?:aa|bb)-)([^-]+)(?=-)')
  3. s = "-a-bc-aa-def-bb-ghij-"
  4. print(p.findall(s))
Success #stdin #stdout 0.01s 9016KB
stdin
Standard input is empty
stdout
['a', 'bc', 'def', 'ghij']