import recontent = "<abc>d<e><f>ghi<j>test><g>"result = re.findall(r"<[^<>]*>|(?:(?!<[^<>]*>).)+", content)print(result)
Standard input is empty
['<abc>', 'd', '<e>', '<f>', 'ghi', '<j>', 'test>', '<g>']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!