I have user entered JSON. This means I sometimes get tabs, newlines etc outside of quotes where they are making it pretty. Prior to processing I'd like to strip these unwanted characters.
For example (from log):
{#015#012#011#011#011#011"dest":"dest@email.com",#015#011#011#011#011"sender":"sender@email."}
In reality
{\r\n\t\t\t\t"dest":"dest@email.com",\r\n\t\t\t\t"sender":"sender@email."}
How can I strip these unwanted characters from outside the quotes, without affecting deliberate characters inside the quotes?