Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to separate string in python by blank line

import re

def split_on_empty_lines(s):

    # greedily match 2 or more new-lines
    blank_line_regex = r"(?:
?
){2,}"

    return re.split(blank_line_regex, s.strip())
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #separate #string #python #blank #line
ADD COMMENT
Topic
Name
1+5 =