Regex-Gen is implemented in all generality in the library (minus some constructs that we still have to add). JSON is merely an application.
You can read https://blog.normalcomputing.ai/posts/2023-07-27-regex-guide... for a more detailed explanation of how it works. Should answer your question :)