Add a new dialect=
argument to st.from_regex()
#4089
Labels
enhancement
it's not broken, but we want it to be better
interop
how to play nicely with other packages
Some time ago, we added a private helper (#3196) in order to support the jsonschema semantics of
$
.I think it's worth making a public API for this, along with considerably stricter validation - i.e. ensure that if we disallow trailing newline for
$
, we also enforce that you're using only the recommended subset of regex syntax which is (with that constraint) identical between Python and Javascript.(cc @Stranger6667 - if we make validation stricter, will that break you? I guess we could do a
jsonschema-python-no-validation
dialect if necessary, practicality beats purity...)Interface: add a new keyword-only argument,
from_regex(..., dialect: Literal["python", "jsonschema"] = "python")
. Obviously this makes it easy - at the interface level, anyway - to support additional dialects in future, if e.g. we can convert them using something like qntm/greenery.The text was updated successfully, but these errors were encountered: