Spliting a string on non alpha characters

stdazi stdazi at gmail.com
Sat Sep 23 10:39:04 EDT 2006


Hello!

I'm relatively new to python but I already noticed that many lines of
python code can be simplified to a oneliner by some clever coder. As
the topics says, I'm trying to split lines like this :

'foo bar- blah/hm.lala' -> [foo, bar, blah, hm, lala]

'foo////bbbar.. xyz' -> [foo, bbbar, xyz]

obviously a for loop catching just chars could do the trick, but I'm
looking for a more elegant way. Anyone can help?




More information about the Python-list mailing list