Ajv: Unicode support in pattern

Created on 19 Jun 2019  路  3Comments  路  Source: ajv-validator/ajv

Ajv Version: 6.10.0

Ajv does not validate the pattern regex using the Unicode flag u, which means that Unicode groups, such as \\p{L} will not work. I believe this can be seen and fixed here: ajv/lib/dot/pattern.jst.

question

Most helpful comment

I don't see where the linked specification, or the ECMAScript specification to which it links, says that the u flag cannot be used, but I see your point about the custom keyword. I will use that. Thank you!

All 3 comments

TBC if it should be used: http://json-schema.org/latest/json-schema-validation.html#rfc.section.6.3.3

You can use custom keyword - e.g. regex in ajv-keywords.

I don't see where the linked specification, or the ECMAScript specification to which it links, says that the u flag cannot be used, but I see your point about the custom keyword. I will use that. Thank you!

Was this page helpful?
0 / 5 - 0 ratings