var str = "{10050203={00=显示页面, 01=查询, 02=新增, 14=分配, 04=修改}, 10050201={00=显示页面, 01=查询, 14=分配}}"; str = str.replace(/ /g, ''); str = str.replace(/{/g, '{"'); str = str.replace(/=/g, '":"'); str = str.replace(/,/g, '","'); str = str.replace(/}/g, '"}'); str = str.replace(/}"/g, '}'); str = str.replace(/"{/g, "{"); str =JSON.parse(str); console.log(str)