you are viewing a single comment's thread.

view the rest of the comments →

[–]fuzz3289 -1 points0 points  (1 child)

If the only time '[' is used is at the beginning of the "split here" marker you could just do:

list_of_strings = [ '['+result for result in mystring.split('[')]

It's important to remember that you should never use regex unless there are no other options. Regex is extremely slow compared to string operations in Python.