有一串json字符串,我需要将其中的时间格式从yyyy-M-d转换为yyyy/M/d,用c#的正则表达式替换的方法怎么写

如下2015-9-24转换为2015/9/24[{"Data":null,"Time":"2015-9-240:00:00"},{"Data":null,"Time":"... 如下2015-9-24转换为2015/9/24
[{"Data":null,"Time":"2015-9-24 0:00:00"},{"Data":null,"Time":"2015-9-24 1:00:00"},{"Data":null,"Time":"2015-9-24 2:00:00"},{"Data":null,"Time":"2015-9-24 3:00:00"},{"Data":null,"Time":"2015-9-24 4:00:00"},{"Data":null,"Time":"2015-9-24 5:00:00"},{"Data":null,"Time":"2015-9-24 6:00:00"},{"Data":null,"Time":"2015-9-24 7:00:00"},{"Data":null,"Time":"2015-9-24 8:00:00"},{"Data":null,"Time":"2015-9-24 9:00:00"},{"Data":null,"Time":"2015-9-24 10:00:00"},{"Data":null,"Time":"2015-9-24 11:00:00"},{"Data":null,"Time":"2015-9-24 12:00:00"},{"Data":null,"Time":"2015-9-24 13:00:00"},{"Data":null,"Time":"2015-9-24 14:00:00"},{"Data":null,"Time":"2015-9-24 15:00:00"},{"Data":null,"Time":"2015-9-24 16:00:00"},{"Data":null,"Time":"2015-9-24 17:00:00"},{"Data":null,"Time":"2015-9-24 18:00:00"},{"Data":null,"Time":"2015-9-24 19:00:00"},{"Data":null,"Time":"2015-9-24 20:00:00"},{"Data":null,"Time":"2015-9-24 21:00:00"},{"Data":null,"Time":"2015-9-24 22:00:00"},{"Data":null,"Time":"2015-9-24 23:00:00"},{"Data":null,"Time":"2015-9-25 0:00:00"}]
展开
 我来答
hanlidongyang
2016-07-26 · TA获得超过885个赞
知道小有建树答主
回答量:1109
采纳率:50%
帮助的人:485万
展开全部
 String s = "[{\"Data\":null,\"Time\":\"2015-9-24 0:00:00\"},{\"Data\":null,\"Time\":\"2015-9-24 1:00:00\"},{\"Data\":null,\"Time\":\"2015-9-24 2:00:00\"},{\"Data\":null,\"Time\":\"2015-9-24 3:00:00\"},{\"Data\":null,\"Time\":\"2015-9-24 4:00:00\"},{\"Data\":null,\"Time\":\"2015-9-24 5:00:00\"},{\"Data\":null,\"Time\":\"2015-9-24 6:00:00\"},{\"Data\":null,\"Time\":\"2015-9-24 7:00:00\"},{\"Data\":null,\"Time\":\"2015-9-24 8:00:00\"},{\"Data\":null,\"Time\":\"2015-9-24 9:00:00\"},{\"Data\":null,\"Time\":\"2015-9-24 10:00:00\"},{\"Data\":null,\"Time\":\"2015-9-24 11:00:00\"},{\"Data\":null,\"Time\":\"2015-9-24 12:00:00\"},{\"Data\":null,\"Time\":\"2015-9-24 13:00:00\"},{\"Data\":null,\"Time\":\"2015-9-24 14:00:00\"},{\"Data\":null,\"Time\":\"2015-9-24 15:00:00\"},{\"Data\":null,\"Time\":\"2015-9-24 16:00:00\"},{\"Data\":null,\"Time\":\"2015-9-24 17:00:00\"},{\"Data\":null,\"Time\":\"2015-9-24 18:00:00\"},{\"Data\":null,\"Time\":\"2015-9-24 19:00:00\"},{\"Data\":null,\"Time\":\"2015-9-24 20:00:00\"},{\"Data\":null,\"Time\":\"2015-9-24 21:00:00\"},{\"Data\":null,\"Time\":\"2015-9-24 22:00:00\"},{\"Data\":null,\"Time\":\"2015-9-24 23:00:00\"},{\"Data\":null,\"Time\":\"2015-9-25 0:00:00\"}]";
            Console.WriteLine(s);
            String s0 = Regex.Replace(s, "([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})", "$1/$2/$3");
            Console.WriteLine(s0);
阳光的雷咩咩
2016-07-26 · TA获得超过1.4万个赞
知道大有可为答主
回答量:2.3万
采纳率:66%
帮助的人:7797万
展开全部

你先试试查找是否成功再说:

201\d-\d-[123]\d [\d:]{7}
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式