The following code splits on successions of newline characters in the following string using Python regex
Example
import re s = """I find Tutorialspoint useful""" print re.split(r"[\n]", s)
Output
This gives the output
['I find', ' Tutorialspoint', ' useful']