Answers for "how to split a line in python by more than one character"

2

how to split and keep delimiter at the same line in python

#split and keep the dlimeters at the end of the line.
#Ex, using the '.'  '?'  '!' as delimeters.

re.split('(?<=!)|(?<=.)|(?<=?)', text)
Posted by: Guest on September-02-2021
12

how to split a string in python with multiple delimiters

>>> a='Beautiful, is; better*thannugly'
>>> import re
>>> re.split('; |, |*|n',a)
['Beautiful', 'is', 'better', 'than', 'ugly']
Posted by: Guest on June-09-2020

Code answers related to "how to split a line in python by more than one character"

Python Answers by Framework

Browse Popular Code Answers by Language