Implement a class/function, which should parse time expressed as `HH:MM:SS`, or `null/nil/None` otherwise.
Any extra characters, or minutes/seconds higher than 59 make the input invalid, and so should return `null/nil/None`.
import re
def to_seconds(time):   
    match=re.fullmatch(r'(\d{2}):([0-5][0-9]):([0-5][0-9])',time)
    return int(match.group(1))*3600+int(match.group(2))*60+int(match.group(3)) if match else None
    

import re
def to_seconds(time):   
    match=re.fullmatch(r'(\d{2}):([0-5][0-9]):([0-5][0-9])',time)
    return int(match.group(1))*3600+int(match.group(2))*60+int(match.group(3)) if match else None
    
