Open eric-bonucci opened 4 years ago
Sorry for missing this issue for a year :scream:
This appears to be an issue with the underling Ajv engine:
const Ajv = require('ajv');
const opts = {allErrors: true,
verbose: true,
unicodeRegExp: true,
strict: true};
const obj = new Ajv(opts);
const schema = {
"type": "object",
"properties":{
"product_type": {
"type": ["string"],
"pattern": "^(?i)test$"
}
},
"required": [
"product_type"
]
}
obj.compile(schema)
which errors with
Thrown:
SyntaxError: Invalid regular expression: /^(?i)test$/: Invalid group
so the error reported is faithful to the underlying engine.
I found this issue on the Ajv repo: https://github.com/ajv-validator/ajv/issues/101, though the link within to "defining custom keywords" is broken - I think this is the relevant page now: https://ajv.js.org/keywords.html
In short, this looks quite hard to support unfortunately
Hi,
When specifying a pattern using a regular expression, one can not use the case insensitive flag in the regex.
Reproducible example (using dplyr):