JSON Schema - Regular Expressions (original) (raw)

The pattern andpatternProperties keywords use regular expressions to express constraints. The regular expression syntax used is from JavaScript (ECMA 262, specifically). However, that complete syntax is not widely supported, therefore it is recommended that you stick to the subset of that syntax described below.

Example

The following example matches a simple North American telephone number with an optional area code:

The following example checks that the string starts with {{ and ends with }}and that it also allows multiline strings.

Need Help?

Did you find these docs helpful?