I am trying to extract hours, mins, seconds and mseconds from a txt file, that may or may not be present in a line. The format is “hh:mm:ss.ms”. I know I should so something like this
int(re.search('(\d+):(\d+):(\d+).(\d+)', current_line).group(1))
but I don’t know how to returns these four values to four different variables.
Well, if you insist on doing it in one line: