0

Consider a string value : "equal to (=23)\nequal to (=45)". How to specify this in a json schema in such a manner that in place of 23 and 45, any number can come?

1
  • Hi! Did you try anything yet? This looks like homework to me, so please explain how we can help your in your attempt. Commented Jan 4, 2016 at 10:50

1 Answer 1

2

The pattern keyword lets you specify a regular expression for a string, for example:

{
    "type": "string",
    "pattern": "^equal to [0-9]+5$"
}

The expression is not anchored by default, so you'll probably want to use ^/$ to specify the start and end.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.