fork(1) download
  1. import re
  2. content = "<abc>d<e><f>ghi<j>test><g>"
  3. result = re.findall(r"<[^<>]*>|(?:(?!<[^<>]*>).)+", content)
  4. print(result)
Success #stdin #stdout 0.01s 27712KB
stdin
Standard input is empty
stdout
['<abc>', 'd', '<e>', '<f>', 'ghi', '<j>', 'test>', '<g>']