{ "_id" : "T_N0051", "Value" : { "AsScript" : "commands=[\"startTalk\",\"nextStep\"];\n\nnpc0=task.NPCBaseInfo[0];\nnpc1=task.NPCBaseInfo[1];\nscene=app.global[\"scene\"];\n\n\tstartTalk(){step=0;if(task.Status==1&&talkNPC==npc0.NPCID){talkPanel.Talk(\"<pcolor='fff799'bColor='753f1f'>恩,你需要帮我找一些有灵性的怪物过来抽取他们的技能,先找一个樱桃小木桩吧。</p>\",talkNPC,false);return;}if(task.Status==2&&talkNPC==npc1.NPCID){talkPanel.Talk(\"<pcolor='fff799'bColor='753f1f'>嗯嗯,就是它。</p>\",talkNPC,false);return;}}nextStep(){if(task.Status==1&&step==0&&talkNPC==npc0.NPCID){talkPanel.Talk(\"<pcolor='fff799'bColor='753f1f'>晕,你不要学我装记性不好,难道你真不知道要打樱桃小木桩么?</p>\",actorHead,false);step++;return;}if(task.Status==1&&step==1&&talkNPC==npc0.NPCID){talkPanel.dispose();return;}if(task.Status==2&&step==0&&talkNPC==npc1.NPCID){sendNotification(\"getAward\",task);talkPanel.dispose();return;}}", "Award" : [{ "Type" : 20001, "Name" : "Experience", "fz" : "", "GoodsID" : "", "Count" : 2800, "AwardID" : 0, "SelectType" : 0, "GoodsType" : "" }, { "Type" : 20001, "Name" : "PetExperience", "fz" : "", "GoodsID" : "", "Count" : 2800, "AwardID" : 1, "SelectType" : 0, "GoodsType" : "" }, { "Type" : 20001, "Name" : "Score", "fz" : "", "GoodsID" : "", "Count" : 1200, "AwardID" : 2, "SelectType" : 0, "GoodsType" : "" }], "BeginStatus" : 0, "Chufa" : [{ "TaskID" : ["T_N0043"] }], "ChufaType" : "TaskFinish", "CompositeType" : 0, "CreateDate" : "2011-07-05 15:01:37", "Description" : "米纳岸不听你的理由,说这是蓝依的占卜结果,你去找蓝依理论", "EndLoop" : "", "Finish" : [{ "Type" : 10008, "Cur" : 0, "Total" : 0 }], "LastHours" : 0, "Level" : 1, "LoopDate" : 1, "LoopTimesDay" : 0, "NPCBaseInfo" : [{ "Type" : 0, "NPCID" : "NPC_A0002", "NPCName" : "米纳岸", "NPCSceneID" : "MAP_A001", "NPCSceneName" : "凡海城" }, { "Type" : 1, "NPCID" : "NPC_A0037", "NPCName" : "蓝依", "NPCSceneID" : "MAP_A002", "NPCSceneName" : "寂寞沙滩" }], "NPCTalk" : "<si>\n <talk p=\"getAward\" event=\"task,false\" status=\"0\" npcIcon=\"\" npc=\"0\">这可不关我老人家的事...这是你从蓝依那里的带回来的占卜结果上写的,就是灵石也是她给我的。如果你不信,可以去问蓝依。</talk>\n <talk p=\"getAward\" event=\"task,true\" status=\"2\" npcIcon=\"\" npc=\"1\">你回来了?我就知道你会回来的。因为我是祭司。奥力奥力嗷~</talk>\n</si>", "RearTask" : "T_N0052", "StartLoop" : "", "TaskType" : 0, "TIMESTAMP" : "1329982372828", "traces" : "<si>\n <i>去寂寞沙滩找蓝依理论占卜的结果</i>\n <status v=\"0\">找凡海城的<a click=\"findRoad\" event=\"NPC_A0002\" SceneID=\"MAP_A001\" un=\"\" color=\"00ff00\">米纳岸</a>接受任务</status>\n <status v=\"2\">去找寂寞沙滩的<a click=\"findRoad\" event=\"NPC_A0037\" SceneID=\"MAP_A002\" un=\"\" color=\"00ff00\">蓝依</a>询问占卜的事情</status>\n</si>", "UpdateDate" : "2012-02-23 15:32:52", "WeituoRenwu" : "{ShiChang:1000,}" }, "Name" : "质问蓝依", "MainType" : "Task", "SubType" : "", "UI" : null, "Author" : "192.168.100.201", "Modified" : ISODate("2012-05-15T03:17:12.614Z"), "Ver" : 2012042001 }
上面的json 我要获取字段内的内容
写了如下正则表达式
[^\\]".*?[^\\]"
提取的部分内容如下
"AwardID"
"SelectType"
"GoodsType"
"" }], "
最后一个就出现问题,"" }], " 字段双引号里面没有内容的就会把后面的东西也匹配出来,
求正则表达式高手支援下,功能其实就是想把所有json的键的内容给找出来 字符串的内容,其他内容可以不要
既然是 json 为啥不用 对象的方式取呢 ?
是用Javascript还是C#代码处理?
不明白为何不直接转换后再取值?
用对象的方式取