Regexp literal instead of constructor invocation.
Test suite for encodeDict.