Description
Describe the bug
I'm using jesse to validate a JSON document with a fairly large schema (https://github.com/jdegre/5GC_APIs/blob/Rel-18/TS29510_Nnrf_NFManagement.yaml).
As part of that validation the IPv6 address ::1
is checked against the regex ^((:|(0?|([1-9a-f][0-9a-f]{0,3}))):)((0?|([1-9a-f][0-9a-f]{0,3})):){0,6}(:|(0?|([1-9a-f][0-9a-f]{0,3})))$
.
This used to work fine, but suddenly fails when switching to 28.0-rc1.
The code that does the validation is in https://github.com/for-GET/jesse/blob/master/src/jesse_lib.erl#L127-L128.
What it does is essentially:
Subject = <<"::1">>,
RE = <<"^((:|(0?|([1-9a-f][0-9a-f]{0,3}))):)((0?|([1-9a-f][0-9a-f]{0,3})):){0,6}(:|(0?|([1-9a-f][0-9a-f]{0,3})))$">>,
Opts = [{capture,none},unicode,ucp],
re:run(Subject, RE, Opts).
When I run that snippet from a small test module or from the CLI, then it works. However, running the exact same Subject
and RE
as part of large project results in a nomatch
. Compiling the regex first does not change the result.
However, when I replace the re:run expression with: re:run(Subject, binary:copy(RE), Opts)
then it also works within the large project.
So far trying to inspet RE
with io:format
and erlang:display
has yield nothing. Is there anything I can do to provide more information?
To Reproduce
unknown
Expected behavior
successfully matches
Affected versions
28.0-rc1
Activity