Add error handling of failed regex compile