refactor regex in time_util