I have a list of strings like
lst = ['foo000bar111', 'foo000bar1112', 'foo000bar1113']
and I want to extract the last numbers from each string to get
nums = ['111', '1112', '1113']
I have other numbers earlier in the string that I don't care about (000 in this example). There aren't spaces, so I can't lst.split() and I believe doing something like that without spacing is difficult. The numbers are of different lengths, so I can't just do str[-3:]. For what it's worth, the characters before the numbers I care about are the same in each string, and the numbers are at the end of the string.
I'm looking for a way to say 'ok, read until you find bar and then tell me what's the rest of the string.' The best I've come up with is [str[(str.index('bar')+3):] for str in lst], which works, but I doubt that's the most pythonic way to do it.