I am writing a JSON parser for .NET and it parses JSON objects near perfectly so far. One problem I'm having, though, is that it will parse simple strings, but will not parse complex strings. Here is an example:
It will parse \"Hi there!\" as a string.
It will not parse \"Hi !*\t\r\n,,{}]][] (.&^.)@!+=~`' there\"
The spec I am using for a JSON string is directly from the JSON website.
My .NET regex strings (as I interpreted from the site) are:
string json_char = @"(\\""|\\\\|\\/|\\b|\\f|\\n|\\r|\\u|[^(\""|\\)])";
string json_string = @"(\""" + json_char + @"*\"")";
The above are exactly as they appear in Visual Studio. Note that with the @ symbols, two double-quotes ("") are required to specify a single double-quote (") character in the actual string value.
The above regex strings match nothing in the second, complex string example I gave above. I've fiddled with the regex strings, but nothing seems to work.
What I want is a regex string that will parse a JSON string as specified by the website. Any help is appreciated.