add tests for RegExp encode/decode parity