help with re.split()

Steve Mak stevemak at softhome.net
Tue Feb 20 13:53:03 EST 2001


Hi guys,

    How do I use the re.split() function so it splits a line of text,
keeping only the word. ie: it excludes any symbols, spaces, etc. I tried
p=re.split('[. ]+', line), but some spaces are being kept.

if the line is Hello, how are you?

I need to split it so I get:
Hello
how
are
you




More information about the Python-list mailing list