Re:Show HN: LLMs can generate valid JSON 100% of the time
by remilouf on Tuesday August 15, 2023 @10:46AM
(#37134638)
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 :)
If arbitrary, how are you pre-defining a set of masks? I would expect that splitting an arbitrary regex into a bunch of contexts for a masking dictionary to be non-trivial.