fork download
  1. import re
  2. s = """Hello world
  3. I am Lucas [help me] (help me 2) <help me 3>
  4. Hi"""
  5. print(s)
  6. print(re.findall(r"\[[^[]*]|\([^)]*\)|<[^>]*>|\S+|(?=\n)", s))
Success #stdin #stdout 0s 23352KB
stdin
Standard input is empty
stdout
Hello world
I am Lucas [help me] (help me 2) <help me 3>
Hi
['Hello', 'world', '', 'I', 'am', 'Lucas', '[help me]', '(help me 2)', '<help me 3>', '', 'Hi']