only load submatch into patternEnv on success (fixes #335)