Hello guys I'm trying to split this string
"1, 2, 3 , 4 , 5, 6,7"
into this array
['1','2','3','4','5','6','7']
And get an error if there are characters or multiple spaces (one white space is acceptable following or before a comma)
I'm doing
re.split(r'\s?,\s?', some_string)
but this does not return an error for invalid matches such as (",," or ", ,"). How could I accomplish that ?