splitting on basis of regex python

Solutions on MaxInterview for splitting on basis of regex python by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "splitting on basis of regex python"
Lenora
14 Sep 2020
1import re
2#a string
3str = '63__foo,,bar,_mango_,apple'
4#split string into chunks
5chunks = re.split('[_,][_,]',str)
6#print chunks
7print(chunks)