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

All tests pass, fixes the error I had in #335