Мне нужно разделить некоторые строки в очень большом массиве, где строки имеют вид:
example = [
"IV - Some text",
"A) Some other text",
"17-ter) an article",
"2), 3) some ugly grouping",
"Some text without any prefix!",
"2), 3) some ugly grouping with (parenthesis)"
]
У меня есть этот код:
import re
s = "b), c) molto altro testo per l\'estrattore"
re.match("(?:([\d\w-]+)[\), \-])*(.*)", s).groups()
Приведенный выше код приводит к:
('b', ", c) molto altro testo per l'estrattore")
мой ожидаемый результат, однако, ('b', 'c', 'molto altro testo per l'estrattore')
.