also support passing a compiled regex in assertErrorRegex