I have lists of strings of which i want to extract a certain value:
["bla","blabla","blablabla","time taken to build model: 5.1 seconds", "blabla"]
Normally I would look for the index of the element I am looking for by
list.index("time taken")
But since the time changes, I think of using a regular expression. I just can't figure out how to do this.
So how can I find out the index of a list element that matches a certain regex like e.g. re.match()? (Without iterating through the list, this would take to long)