Why am I getting an UnboundLocalError in my Python regex function for parsing logs

welcome to shbcf.ru