I'm trying to split the string in to two strings
INPUT: "ASSO|ASSOCS|AS|ASSOCIATES/ASSOC/"
OUTPUT: "ASSO|ASSOCS|AS|ASSOCIATES","ASSOC"
Tried :
I tried removing the the last character "/" first and replaced the other with ",". Wanted to know can we do this both steps in once using regex
str=str.replace(/\/$/, "")
str=str.replace(\/,",")
filter(None, str.split('/'))print(",".join(filter(None, INPUT.split('/'))))re.findall(r"[^/]+", s)re.finditer("(.+?)/", INPUT)?