Q:

How to get key and value from a string

I have a question about how to write a regex expression to get the key and value pairs from below string?
{"ReturnCode":"0","ErrorMsg":"success","EncryToken":"@@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}

Could someone help me learn on what this can be done?
Thanks very much.

A:

This one should suit your needs:
"([^"]+)"\s*:\s*"([^"]+)"

The key is in the first group, the value in the second one.
Visualization by Debuggex

