dimanche 28 juin 2015

Regex matching multiple delimiters

I am trying to split on the following delimiters: full stop, semi-colon, *, +, ? and -

I tried the following but I am not making any progress, any help will be appreciated:

sentences = re.split("[.-;]*[\+]*[\?]*[\*]*", txt)

here is the sample text I've been trying this on:

- Text Editor: Now you can edit plain text files with airport tools
* Updated Dropbox support 
* Improved
stability
- New icon

Expected output after the split is a list of items:

TextEditor: Now you can edit plain text files with airport tools, Updated Dropbox support, Improved stability, New icon

Aucun commentaire:

Enregistrer un commentaire