Using regex to split list of strings into list of lists based on starting character

Multi tool use
Multi tool use
The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


Using regex to split list of strings into list of lists based on starting character



I have a very long list of 9000+ elements. For example Sample is below:


lst = ['0sbsd uu', '7fsfss us', 'Bsfsd ll', 'Zufss dl', 'fasfs ff', '8fsdr2 us', 'It fss', 'Fsffsfds f']



I have to split lst into a list of 15 "almost" equal size sublists such that each sublist contains all the entries starting with a given character range (say 0 - c, d - h, ....).


lst


0 - c, d - h, ....









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

OCfjdIDD n3s9EtmHL4FY9oLAT,Wr,uSCy9AGicsJSZXw0VI7fkk8dtd0mgA5hXO,eFEUKuL
U kf,PQ6BL5iU5DDTYGsRzmGKTz

Popular posts from this blog

Makefile test if variable is not empty

Visual Studio Code: How to configure includePath for better IntelliSense results

Will Oldham