You can use the following regex [,\s]+ to find your delimiters.

Here is an example on python:

import re
text = "item1, item2 item3    item4 , item5"
result = re.split(r'[,\s]+', text)

This code return the following output:

['item1', 'item2', 'item3', 'item4', 'item5']

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top