0
text = "Some text here 09:00 - Movies 10:00 - Cartoons 11:00 SPorts .... 20:00 - News Another text here"

I am trying to get only the parts with the time in front.Here is my code:

match = findall('\d\d:\d\d\s-\s\D+', text)

My problem is that at the end i said to read until finding a digit,and when it reaches the last time 20:00 - News it prints "Another text here" too.How can i modify ti print only "09:00 - Movies 10:00 - Cartoons 11:00 SPorts .... 20:00 - News ".

Thanks.

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by pyTony
0

I think easiest would be to just post process apropriately the last match from list of matches. You could also prove \w+ instead of \D+.

Edited by pyTony: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.