I have some JSON data but all the keys are in UPPER case. How to parse them and convert the keys to lower? I am using jQuery.
for example:
JSON data:
{"ID":1234, "CONTENT":"HELLO"}
Desired output:
{id:1234, content:"HELLO"}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
How about this:
The regex captures the key name $1 and converts it to lower case.
Live demo: http://jsfiddle.net/bHz7x/1/
[edit] To address @FabrícioMatté’s comment, another demo that only matches word characters: http://jsfiddle.net/bHz7x/4/