It's just the way people usually input timeline. For example, people usually type a timeline with such a format in comment zone. Human can recognize chapter with this format and so does program.
And with some little change, we can get a format that also contains tab format and simple format. A regex pattern can be
r"(?P<time>[0-9]+:[0-9]{1,2}[0-9:.]*)([\s,]+(?P<name1>.+)|(?P<name2>[^\d:.\s,].+))" # only one of name1 and name2 will be matched
Accept input with spaces or no specific characters as delimiter. eg:
It's just the way people usually input timeline. For example, people usually type a timeline with such a format in comment zone. Human can recognize chapter with this format and so does program.
And with some little change, we can get a format that also contains
tab format
andsimple format
. A regex pattern can be