I am quite new to Regular expressions. I want to filter out a Http GetRequest string and return the tokens as a Dictionary object so I can find each token. For example, the string returned is as follows
"{\"currencyCode\":\"CAD\",\"id\":\"29BKR08JSRJ5BE11LD\",\"link\":[{\"rel\":\"hosted_payment\",\"uri\":\"https://pay.test.netbanx.com/hosted/v1/payment/53616c7465645f5fcb770fe4ad39262c27ae2fba4189e1ef89aacc3fac4e0fc0ba7d1699c4a50672\"},{\"rel\":\"self\",\"uri\":\"https...\"},{\"rel\":\"resend_callback\",\"uri\":\"https://37520-1001043850:B-qa2-0-56797b63-0-302c02147c32c6cad7f273be1c06cc7377a22520ce4d31af0214541d250968177ad25a4041ef9c039accca483132@api.test.netbanx.com/hosted/v1/orders/29BKR08JSRJ5BE11LD/resend_callback\"}],\"merchantRefNum\":\"fd63cb9d-b586-664d-9bba-8492baf4bad9\",\"mode\":\"live\",\"totalAmount\":\"100\",\"type\":\"order\"}"
I want to return the currencyCode as the Key and CAD as the Value. Same goes for the link, rel => hosted_payment, uri => https://.....
I am using the following but it is not what I want
Regex regex = new Regex(@"((""((?<token>.*?)(?<!\\)"")|(?<token>[\w]+))(\s)*)",
RegexOptions.None);
return (from Match m in regex.Matches(orderResp)
where m.Groups["token"].Success
select m.Groups["token"].Value).ToArray();
Thanks in advance