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
string ="someText:someValue~" print re.split("(:|~)",string,1)
If you put in group,it will appear in the list returned.You can find it from 1 index of list.
1