title: Using RegEx in JSON Schema
body: <p>Trying to write a JSON schema that uses RegEx to validate a value of an item.</p>
  
  <p>Have an item named <strong>progBinaryName</strong> whose value should adhrere to this RegEx string <code>"^[A-Za-z0-9 -_]+_Prog\\.(exe|EXE)$"</code>.</p>
  
  <p>Can not find any tutorials or examples that actually explain the use of RegEx in a JSON schema.</p>
  
  <p>Any help/info would be GREATLY appreciated!</p>
  
  <p>Thanks,
  D</p>
  
  <p>JSON SCHEMA</p>
  
  <pre><code>{
      "name": "string",
      "properties": {
          "progName": {
              "type": "string",
              "description": "Program Name",
              "required": true
          },
          "ID": {
              "type": "string",
              "description": "Identifier",
              "required": true
          },
          "progVer": {
              "type": "string",
              "description": "Version number",
              "required": true
          },
          "progBinaryName": {
              "type": "string",
              "description": "Actual name of binary",
              "patternProperties": {
                  "progBinaryName": "^[A-Za-z0-9 -_]+_Prog\\.(exe|EXE)$"
              },
              "required": true
          }
      }
  }
  </code></pre>
  
  <p>ERRORS:</p>
  
  <p>Warning! Better check your JSON.</p>
  
  <p>Instance is not a required type - <a href="http://json-schema.org/draft-03/hyper-schema#" rel="noreferrer">http://json-schema.org/draft-03/hyper-schema#</a></p>
  
  <hr>
  
  <p>Schema is valid JSON, but not a valid schema.</p>
  
  <hr>
  
  <p>Validation results: failure</p>
  
  <pre><code>[ {
      "level" : "warning",
      "schema" : {
          "loadingURI" : "#",
          "pointer" : ""
      },
      "domain" : "syntax",
      "message" : "unknown keyword(s) found; ignored",
      "ignored" : [ "name" ]
  }, {
      "level" : "error",
      "domain" : "syntax",
      "schema" : {
          "loadingURI" : "#",
          "pointer" : "/properties/ID"
      },
      "keyword" : "required",
      "message" : "value has incorrect type",
      "expected" : [ "array" ],
      "found" : "boolean"
  }, {
      "level" : "error",
      "domain" : "syntax",
      "schema" : {
          "loadingURI" : "#",
          "pointer" : "/properties/progBinaryName"
      },
      "keyword" : "required",
      "message" : "value has incorrect type",
      "expected" : [ "array" ],
      "found" : "boolean"
  }, {
      "level" : "error",
      "schema" : {
          "loadingURI" : "#",
          "pointer" : "/properties/progBinaryName/patternProperties/progBinaryName"
      },
      "domain" : "syntax",
      "message" : "JSON value is not a JSON Schema: not an object",
      "found" : "string"
  }, {
      "level" : "error",
      "domain" : "syntax",
      "schema" : {
          "loadingURI" : "#",
          "pointer" : "/properties/progName"
      },
      "keyword" : "required",
      "message" : "value has incorrect type",
      "expected" : [ "array" ],
      "found" : "boolean"
  }, {
      "level" : "error",
      "domain" : "syntax",
      "schema" : {
          "loadingURI" : "#",
          "pointer" : "/properties/progVer"
      },
      "keyword" : "required",
      "message" : "value has incorrect type",
      "expected" : [ "array" ],
      "found" : "boolean"
  } ]
  </code></pre>
  
  <hr>
  
  <pre><code>Problem with schema#/properties/progBinaryName/patternProperties/progBinaryName : Instance is not a required type
  Reported by http://json-schema.org/draft-03/hyper-schema#
  Attribute "type" (["object"])
  </code></pre>