make regex error logging more useful