ruby: add regex decoding.