JSON Schema validation fails

Issue #347 closed
Former user created an issue

Following pattern that is fine according to regex tester (regex101.com):

pattern: '^(?!\s)[0-9_.,-\\/ A-Za-z]*(?<!\s)$'

fails:

ERROR - Invalid JSON Schema, cannot continue\n\tSyntax errors:\n\t[ {\n\t \"level\" : \"error\",\n\t \"message\" : \"string \\"^(?!\\s)[0-9_.,\\-\\\\\\/ A-Za-z](?<!\\s)$\\" is not a valid ECMA 262 regular expression\",\n\t \"domain\" : \"syntax\",\n\t \"schema\" : {\n\t \"loadingURI\" : \"#\",\n\t \"pointer\" : \"/properties/name/allOf/0\"\n\t },\n\t \"keyword\" : \"pattern\",\n\t \"value\" : \"^(?!\\s)[0-9_.,\\-\\\\\\/ A-Za-z](?<!\\s)$\"\n\t} ]: []

Comments (3)

  1. Sven Döring

    The Regex is using lookbehind assertions. That is supported since ECMAScript 2018.

    The used JavaScript engine (either Nashorn or Rhino) in the project only supports ECMAScript 5 (2009).

  2. Log in to comment