Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
I am surprised that an answer to this is not easily found.
I am in the process of making a JSON schema. I have an object and one of it's properties is a string containing a regex pattern. This property must contain only regex.
So, this question is realistically two questions in one:
What is the regex pattern that describes regex patterns (javascript-compatible please)?
Secondly, how do I apply this to JSON schema (in the "pattern"
property or even in the "patternProperty"
1 property)?
1: I have no idea what purpose would require you to apply this in "patternProperty"
, but someone out there could find it useful
NOTE: Since, JSONschema is JSON and JSON is JavaScript-based, JavaScript scripters may find the solution (to the JSONschema-side of the question), as well as the problem, useful in their scripts.