C# format JSON with backslash '\' in value
<p>I have some JSON from a third party system that contains backslashes in the value.  For example:</p>

<pre><code>string extract = @"{""key"": ""\/Date(2015-02-02)\/""}";
</code></pre>

<p>which without the c# string escaping corresponds to the string:</p>

<pre><code>{"key": "\/Date(2015-02-02)\/"}
</code></pre>

<p>I'd like to be able to format (e.g. indent) this JSON.</p>

<p>Typically for formatting, I might use something like JsonConvert like so:</p>

<pre><code>JsonConvert.SerializeObject(JsonConvert.DeserializeObject(extract), Formatting.Indented)
</code></pre>

<p>This doesn't quite work, as it sees the value as a date, but as it's not in the standard MS format of <code>\/Date(ticks)\/</code>, it goes to a date of 1 Jan 1970:</p>

<pre><code>{
  "key": "1970-01-01T00:00:02.015+00:00"
}
</code></pre>

<p>Next approach is to use the serializer settings to not convert dates (I'm not bothered whether it recognises the field as a date, although it would probably be handy later on):</p>

<pre><code>JsonSerializerSettings settings = new JsonSerializerSettings
{
    DateParseHandling = DateParseHandling.None,
};

JsonConvert.SerializeObject(JsonConvert.DeserializeObject(extract, settings), Formatting.Indented);
</code></pre>

<p>This appears to have treated the backslash as an escape character during the deserialization, so it is "lost" once I see the final result:</p>

<pre><code>{
  "key": "/Date(2015-02-02)/"
}
</code></pre>

<p>Is there a way that I can format the JSON in C# (with or without JsonConvert), that will preserve the backslash in the value?</p>

<p>Note that the real JSON I am dealing with is (a) reasonably large, but not too large for some regex/find-replace solution, if really necessary (b) not under my control, so I can't change the format.  I'm sure the answer is already on StackOverflow, but I'm finding it difficult to find the right search terms...</p>