I am trying to split a string in python before a specific word. For example, I would like to split the following string before \"path:\".
\"path:\"
You could do ["path:"+s for s in line.split("path:")[1:]] instead of using a regex. (note that we skip first match, that has no "path:" prefix.
["path:"+s for s in line.split("path:")[1:]]