Match the complete env name, not just a prefix

The function originally gave up after matching envKey; it
did not check if it matched a prefix instead of the complete env name.
Removed parentheses