Categories
Development

Regex python – Match newline only if it is followed by number or special character and space

I’ve been trying to figure out this regex in Python but it’s not been producing the expected result. I have a text file which I load that is in the format of: “18 75 19\n!dont split here\n! but split here\n* and split here” I’d like to get the following output: [’18 75 19\n!dont split here’, […]