I'm trying to solve a relatively simple parsing issue that regex seems like it would be great for. I'm still trying to wrap my head around the notation, so I was hoping to get a nudge in the right direction for what I'm trying to do. The string I have is in this format:
x = 'Testing - 12:34: I dont want this number at the end 4567:'
From what I've been able to write:
test = re.findall(r'\b(\d+)\b',x)
will give the output of
['12', '34', '4567']
It's close, but not quite there. The problem is not every string I'm going to be scanning at the end, so I'd like to have a regex statement rather than just
test = test[:2]
Essentially, the condition I'm trying to articulate is 'take the numbers between the - and second :, but nothing else.' (ie 12:34 in the form ['12','34]). Is this possible? Thank you!