How to split string with multiple delimiters and find out which delimiter was used to split the string with a maxsplit of 1.
import re string =\"someText:so
You may use re.findall.
>>> string ="someText:someValue~" >>> re.findall(r'^([^:~]*)([:~])([^:~].*)', string) [('someText', ':', 'someValue~')]