santhosh-tekuri/jsonschema

How can I validate to Python re flavor regex?

Closed this issue · 4 comments

Is there a way to validate the regex to Python re flavor regex rather than Golang regex?

I saw these changes, but I don't understand how I would make it validate to Python. bbc9f89

I guess I need to do something like

c.Formats["regex"] = func(

then provide a custom validator? How can I validate Python Regex in Go code?

You have to use some golang library which provides python flavoured regex. I am not sure of any such library.

with the commit you mentioned, such library can be used in both c.Formats["regex"] and Compiler.CompileRegex

If I make a change to c.Formats["regex"], I assume that I don't need to change Compiler.CompileRegex as well? @santhosh-tekuri

You need to add both