fork(1) download
  1. import re
  2. p = re.compile(r'(AA|BB)(.*)\1')
  3. test_str = "AA text AA"
  4. print([x.group(2).strip() for x in p.finditer(test_str)])
Success #stdin #stdout 0.02s 9016KB
stdin
Standard input is empty
stdout
['text']