Let say JSON string is given, and I want to validate using C#. We all know that JSON string has the following format
string jsonStr = {"Id":123,"Value":"asdf","Time":"adf","isGood":false}];
I want to take care of Number, String, Boolean, Null types for now. I can see that the pattern of JSON is
{ + " + String + " + : + (Number)|(Boolean)|(" + String + ")|(Null) + , + ... + } + ]
// ... means one or more
I am really new to Regular Expression, so I have no idea... Could anyone kindly help me out?
EDIT
Sorry, I am not using JSON.NET and I don't want to use it. I found that using Regex is the only way to validate my JSON string. If there is any suggestion, I will go for it. Thank you
EDIT2
My question is "How to validate JSON using Regex", and not "Should I validate JSON using Regex". You guys probably understand that company has own policy "not to use 3rd-party resource". What should I do guys? I am just NOT ALLOWED to use it.