title: JSON (schema) validation with escaped characters in patterns fails
body: <p>The following JSON object is valid:</p>
  
  <pre><code>{
      "foo": "bar",
      "pattern": "^(\/?[-a-zA-Z0-9_.]+)+$"
  }
  </code></pre>
  
  <p>Whereas this one is <strong>not</strong>:</p>
  
  <pre><code>{
      "foo": "bar",
      "pattern": "^(\/?[-a-zA-Z0-9_.]+)+\.jpg$"
  }
  </code></pre>
  
  <p>It's the escaped <strong>dot</strong> (<code>\.</code>), but I can't see why this should not be valid JSON. I need to include such patterns in my real JSON schemas. The regexp there are far more complex and there is no way missing out on excaping, especially the dot. </p>
  
  <p>BTW, escaping <em>hypens</em> in <em>character classes</em> such as in <code>[a-z\-]</code> breaks validation as well.</p>
  
  <p>How do I fix that?</p>
  
  <p>Edit: I used <a href="http://jsonlint.com" rel="noreferrer">http://jsonlint.com</a> and a couple of node libraries.</p>